8000 minix/minix/tests/common-socket.c at master · grzetzp/minix · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
2163 lines (1683 loc) · 48.3 KB

common-socket.c

File metadata and controls

2163 lines (1683 loc) · 48.3 KB
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include "common.h"
#include "common-socket.h"
#define ISO8601_FORMAT "%Y-%m-%dT%H:%M:%S"
/* timestamps for debug and error logs */
static char *get_timestamp(void)
{
struct tm *tm;
time_t t;
size_t len;
char *s;
len = sizeof(char) * 32;
t = time(NULL);
if (t == -1) {
return NULL;
}
tm = gmtime(&t);
if (tm == NULL) {
return NULL;
}
s = (char *) malloc(len);
if (!s) {
perror("malloc");
return NULL;
}
memset(s, '\0', len);
strftime(s, len - 1, ISO8601_FORMAT, tm);
return s;
}
void test_fail_fl(char *msg, char *file, int line)
{
char *timestamp;
int e;
e = errno;
timestamp = get_timestamp();
if (errct == 0) fprintf(stderr, "\n");
errno = e;
fprintf(stderr, "[ERROR][%s] (%s Line %d) %s [pid=%d:errno=%d:%s]\n",
timestamp, file, line, msg, getpid(), errno, strerror(errno));
fflush(stderr);
if (timestamp != NULL) {
free(timestamp);
timestamp = NULL;
}
errno = e;
e(7);
}
#if DEBUG == 1
void debug_fl(char *msg, char *file, int line)
{
char *timestamp;
timestamp = get_timestamp();
fprintf(stdout,"[DEBUG][%s] (%s:%d) %s [pid=%d]\n",
timestamp, __FILE__, __LINE__, msg, getpid());
fflush(stdout);
if (timestamp != NULL) {
free(timestamp);
timestamp = NULL;
}
}
#endif
void test_socket(const struct socket_test_info *info)
{
struct stat statbuf, statbuf2;
int sd, sd2;
int rc;
int i;
debug("entering test_socket()");
debug("Test socket() with an unsupported address family");
errno = 0;
sd = socket(-1, info->type, 0);
if (!(sd == -1 && errno == EAFNOSUPPORT)) {
test_fail("socket");
if (sd != -1) {
CLOSE(sd);
}
}
debug("Test socket() with all available FDs open by this process");
for (i = 3; i < getdtablesize(); i++) {
rc = open("/dev/null", O_RDONLY);
if (rc == -1) {
test_fail("we couldn't open /dev/null for read");
}
}
errno = 0;
sd = socket(info->domain, info->type, 0);
if (!(sd == -1 && errno == EMFILE)) {
test_fail("socket() call with all fds open should fail");
if (sd != -1) {
CLOSE(sd);
}
}
for (i = 3; i < getdtablesize(); i++) {
CLOSE(i);
}
debug("Test socket() with an mismatched protocol");
errno = 0;
sd = socket(info->domain, info->type, 4);
if (!(sd == -1 && errno == EPROTONOSUPPORT)) {
test_fail("socket() should fail with errno = EPROTONOSUPPORT");
if (sd != -1) {
CLOSE(sd);
}
}
debug("Test socket() success");
/*
* open 2 sockets at once and *then* close them.
* This will test that /dev/uds is cloning properly.
*/
SOCKET(sd, info->domain, info->type, 0);
SOCKET(sd2, info->domain, info->type, 0);
rc = fstat(sd, &statbuf);
if (rc == -1) {
test_fail("fstat failed on sd");
}
rc = fstat(sd2, &statbuf2);
if (rc == -1) {
test_fail("fstat failed on sd2");
}
if (statbuf.st_dev == statbuf2.st_dev) {
test_fail("/dev/uds isn't being cloned");
}
CLOSE(sd2);
CLOSE(sd);
debug("leaving test_socket()");
}
void test_getsockname(const struct socket_test_info *info)
{
int sd;
int rc;
int on;
struct sockaddr_storage sock_addr;
socklen_t sock_addr_len;
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc == -1) {
test_fail("bind() should have worked");
}
debug("Test getsockname() success");
memset(&sock_addr, '\0', sizeof(sock_addr));
sock_addr_len = sizeof(sock_addr);
rc = getsockname(sd, (struct sockaddr *) &sock_addr, &sock_addr_len);
if (rc == -1) {
test_fail("getsockname() should have worked");
}
info->callback_check_sockaddr((struct sockaddr *) &sock_addr,
sock_addr_len, "getsockname", 1);
CLOSE(sd);
}
void test_bind(const struct socket_test_info *info)
{
struct sockaddr_storage sock_addr;
socklen_t sock_addr_len;
int sd;
int sd2;
int rc;
int on;
debug("entering test_bind()");
info->callback_cleanup();
debug("Test bind() success");
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc == -1) {
test_fail("bind() should have worked");
}
debug("Test getsockname() success");
memset(&sock_addr, '\0', sizeof(sock_addr));
sock_addr_len = sizeof(sock_addr);
rc = getsockname(sd, (struct sockaddr *) &sock_addr, &sock_addr_len);
if (rc == -1) {
test_fail("getsockname() should have worked");
}
info->callback_check_sockaddr((struct sockaddr *) &sock_addr,
sock_addr_len, "getsockname", 1);
debug("Test bind() with a address that has already been bind()'d");
SOCKET(sd2, info->domain, info->type, 0);
errno = 0;
rc = bind(sd2, info->serveraddr, info->serveraddrlen);
if (!((rc == -1) && (errno == EADDRINUSE))) {
test_fail("bind() should have failed with EADDRINUSE");
}
CLOSE(sd2);
CLOSE(sd);
info->callback_cleanup();
debug("Test bind() with a NULL address");
SOCKET(sd, info->domain, info->type, 0);
errno = 0;
rc = bind(sd, (struct sockaddr *) NULL,
sizeof(struct sockaddr_storage));
if (!((rc == -1) && (errno == EFAULT))) {
test_fail("bind() should have failed with EFAULT");
}
CLOSE(sd);
debug("leaving test_bind()");
}
void test_listen(const struct socket_test_info *info)
{
int rc;
debug("entering test_listen()");
debug("Test listen() with a bad file descriptor");
errno = 0;
rc = listen(-1, 0);
if (!(rc == -1 && errno == EBADF)) {
test_fail("listen(-1, 0) should have failed");
}
debug("Test listen() with a non-socket file descriptor");
errno = 0;
rc = listen(0, 0);
/* Test on errno disabled here: there's currently no telling what this
* will return. POSIX says it should be ENOTSOCK, MINIX3 libc returns
* ENOSYS, and we used to test for ENOTTY here..
*/
if (!(rc == -1)) {
test_fail("listen(0, 0) should have failed");
}
debug("leaving test_listen()");
}
void test_shutdown(const struct socket_test_info *info)
{
int how[3] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
int sd;
int rc;
int i;
debug("entering test_shutdown()");
/* test for each direction (read, write, read-write) */
for (i = 0; i < 3; i++) {
debug("test shutdown() with an invalid descriptor");
errno = 0;
rc = shutdown(-1, how[i]);
if (!(rc == -1 && errno == EBADF)) {
test_fail("shutdown(-1, how[i]) should have failed");
}
debug("test shutdown() with a non-socket descriptor");
errno = 0;
rc = shutdown(0, how[i]);
if (!(rc == -1 && errno == ENOTSOCK)) {
test_fail("shutdown() should have failed with "
"ENOTSOCK");
}
debug("test shutdown() with a socket that is not connected");
SOCKET(sd, info->domain, info->type, 0);
errno = 0;
rc = shutdown(sd, how[i]);
if (rc != 0 && !(rc == -1 && errno == ENOTCONN)) {
test_fail("shutdown() should have failed");
}
CLOSE(sd);
}
SOCKET(sd, info->domain, info->type, 0);
errno = 0;
rc = shutdown(sd, -1);
if (!(rc == -1 && errno == EINVAL)) {
test_fail("shutdown(sd, -1) should have failed with EINVAL");
}
CLOSE(sd);
debug("leaving test_shutdown()");
}
void test_close(const struct socket_test_info *info)
{
int sd, sd2;
int rc, i, on;
debug("entering test_close()");
info->callback_cleanup();
debug("Test close() success");
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc != 0) {
test_fail("bind() should have worked");
}
CLOSE(sd);
debug("Close an already closed file descriptor");
errno = 0;
rc = close(sd);
if (!(rc == -1 && errno == EBADF)) {
test_fail("close(sd) should have failed with EBADF");
}
info->callback_cleanup();
debug("dup()'ing a file descriptor and closing both should work");
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc != 0) {
test_fail("bind() should have worked");
}
errno = 0;
sd2 = dup(sd);
if (sd2 == -1) {
test_fail("dup(sd) should have worked");
} else {
CLOSE(sd2);
CLOSE(sd);
}
info->callback_cleanup();
/* Create and close a socket a bunch of times.
* If the implementation doesn't properly free the
* socket during close(), eventually socket() will
* fail when the internal descriptor table is full.
*/
for (i = 0; i < 1024; i++) {
SOCKET(sd, info->domain, info->type, 0);
CLOSE(sd);
}
debug("leaving test_close()");
}
void test_sockopts(const struct socket_test_info *info)
{
int i;
int rc;
int sd;
int option_value;
socklen_t option_len;
debug("entering test_sockopts()");
for (i = 0; i < info->typecount; i++) {
SOCKET(sd, info->domain, info->types[i], 0);
debug("Test setsockopt() works");
option_value = 0;
option_len = sizeof(option_value);
errno = 0;
rc = getsockopt(sd, SOL_SOCKET, SO_TYPE, &option_value,
&option_len);
if (rc != 0) {
test_fail("setsockopt() should have worked");
}
if (option_value != info->types[i]) {
test_fail("SO_TYPE didn't seem to work.");
}
CLOSE(sd);
}
SOCKET(sd, info->domain, info->type, 0);
debug("Test setsockopt() works");
option_value = 0;
option_len = sizeof(option_value);
errno = 0;
rc = getsockopt(sd, SOL_SOCKET, SO_SNDBUF, &option_value, &option_len);
if (info->expected_sndbuf >= 0 &&
option_value != info->expected_sndbuf) {
test_fail("SO_SNDBUF didn't seem to work.");
}
CLOSE(sd);
SOCKET(sd, info->domain, info->type, 0);
debug("Test setsockopt() works");
option_value = 0;
option_len = sizeof(option_value);
errno = 0;
rc = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &option_value, &option_len);
if (rc != 0) {
test_fail("getsockopt() should have worked");
}
if (info->expected_rcvbuf >= 0 &&
option_value != info->expected_rcvbuf) {
test_fail("SO_RCVBUF didn't seem to work.");
}
CLOSE(sd);
debug("leaving test_sockopts()");
}
void test_read(const struct socket_test_info *info)
{
int rc;
int fd;
char buf[BUFSIZE];
debug("entering test_read()");
errno = 0;
rc = read(-1, buf, sizeof(buf));
if (!(rc == -1 && errno == EBADF)) {
test_fail("read() should have failed with EBADF");
}
fd = open("/tmp", O_RDONLY);
if (fd == -1) {
test_fail("open(\"/tmp\", O_RDONLY) should have worked");
}
CLOSE(fd);
debug("leaving test_read()");
}
void test_write(const struct socket_test_info *info)
{
int rc;
char buf[BUFSIZE];
debug("entering test_write()");
errno = 0;
rc = write(-1, buf, sizeof(buf));
if (!(rc == -1 && errno == EBADF)) {
test_fail("write() should have failed with EBADF");
}
debug("leaving test_write()");
}
void test_dup(const struct socket_test_info *info)
{
struct stat info1;
struct stat info2;
int sd, sd2;
int rc;
int i, on;
debug("entering test_dup()");
info->callback_cleanup();
debug("Test dup()");
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc != 0) {
test_fail("bind() should have worked");
}
errno = 0;
sd2 = dup(sd);
if (sd2 == -1) {
test_fail("dup(sd) should have worked");
}
rc = fstat(sd, &info1);
if (rc == -1) {
test_fail("fstat(fd, &info1) failed");
}
rc = fstat(sd2, &info2);
if (rc == -1) {
test_fail("fstat(sd, &info2) failed");
}
if (info1.st_ino != info2.st_ino) {
test_fail("dup() failed info1.st_ino != info2.st_ino");
}
CLOSE(sd);
CLOSE(sd2);
debug("Test dup() with a closed socket");
errno = 0;
rc = dup(sd);
if (!(rc == -1 && errno == EBADF)) {
test_fail("dup(sd) on a closed socket shouldn't have worked");
}
debug("Test dup() with socket descriptor of -1");
errno = 0;
rc = dup(-1);
if (!(rc == -1 && errno == EBADF)) {
test_fail("dup(-1) shouldn't have worked");
}
debug("Test dup() when all of the file descriptors are taken");
SOCKET(sd, info->domain, info->type, 0);
for (i = 4; i < getdtablesize(); i++) {
rc = open("/dev/null", O_RDONLY);
if (rc == -1) {
test_fail("we couldn't open /dev/null for read");
}
}
errno = 0;
sd2 = dup(sd);
if (!(sd2 == -1 && errno == EMFILE)) {
test_fail("dup(sd) should have failed with errno = EMFILE");
}
for (i = 3; i < getdtablesize(); i++) {
CLOSE(i);
}
info->callback_cleanup();
debug("leaving test_dup()");
}
void test_dup2(const struct socket_test_info *info)
{
struct stat info1;
struct stat info2;
int sd;
int fd;
int rc;
int on;
debug("entering test_dup2()");
info->callback_cleanup();
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc != 0) {
test_fail("bind() should have worked");
}
fd = open("/dev/null", O_RDONLY);
if (fd == -1) {
test_fail("open(\"/dev/null\", O_RDONLY) failed");
}
fd = dup2(sd, fd);
if (fd == -1) {
test_fail("dup2(sd, fd) failed.");
}
memset(&info1, '\0', sizeof(struct stat));
memset(&info2, '\0', sizeof(struct stat));
rc = fstat(fd, &info1);
if (rc == -1) {
test_fail("fstat(fd, &info1) failed");
}
rc = fstat(sd, &info2);
if (rc == -1) {
test_fail("fstat(sd, &info2) failed");
}
if (!(info1.st_ino == info2.st_ino &&
major(info1.st_dev) == major(info2.st_dev) &&
minor(info1.st_dev) == minor(info2.st_dev))) {
test_fail("dup2() failed");
}
CLOSE(fd);
CLOSE(sd);
info->callback_cleanup();
debug("leaving test_dup2()");
}
/*
* A toupper() server. This toy server converts a string to upper case.
*/
static void test_xfer_server(const struct socket_test_info *info, pid_t pid)
{
int i;
struct timeval tv;
fd_set readfds;
int status;
int rc;
int sd;
int on;
unsigned char buf[BUFSIZE];
socklen_t client_addr_size;
int client_sd;
struct sockaddr_storage client_addr;
status = 0;
rc = 0;
sd = 0;
client_sd = 0;
client_addr_size = sizeof(struct sockaddr_storage);
memset(&buf, '\0', sizeof(buf));
memset(&client_addr, '\0', sizeof(client_addr));
SOCKET(sd, info->domain, info->type, 0);
on = 1;
(void)setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
rc = bind(sd, info->serveraddr, info->serveraddrlen);
if (rc == -1) {
test_fail("bind() should have worked");
}
rc = listen(sd, 8);
if (rc == -1) {
test_fail("listen(sd, 8) should have worked");
}
/* we're ready for connections, time to tell the client to start
* the test
*/
kill(pid, SIGUSR1);
tv.tv_sec = 10;
tv.tv_usec = 0;
FD_ZERO(&readfds);
FD_SET(sd, &readfds);
/* use select() in case the client is really broken and never
* attempts to connect (we don't want to block on accept()
* forever).
*/
rc = select(sd + 1, &readfds, NULL, NULL, &tv);
if (rc == -1) {
test_fail("[server] select() should not have failed");
}
if (rc != 1) {
test_fail("[server] select() should have returned 1");
printf("[server] select returned %d\n", rc);
}
if (!(FD_ISSET(sd, &readfds))) {
test_fail("[server] client didn't connect within 10 seconds");
kill(pid, SIGKILL);
return;
}
client_sd = accept(sd, (struct sockaddr *) &client_addr,
&client_addr_size);
if (client_sd == -1) {
test_fail("accept() should have worked");
kill(pid, SIGKILL);
return;
} else {
debug("[server] client accept()'d");
}
debug("[server] Reading message");
rc = read(client_sd, buf, sizeof(buf));
if (rc == -1) {
test_fail("read() failed unexpectedly");
kill(pid, SIGKILL);
return;
}
debug("[server] we got the following message:");
debug(buf);
for (i = 0; i < rc && i < 127; i++) {
buf[i] = toupper(buf[i]);
}
debug("[server] Writing message...");
rc = write(client_sd, buf, sizeof(buf));
if (rc == -1) {
test_fail("write(client_sd, buf, sizeof(buf)) failed");
kill(pid, SIGKILL);
return;
}
if (rc < strlen((char *)buf)) {
test_fail("[server] write didn't write all the bytes");
}
memset(&buf, '\0', sizeof(buf));
debug("[server] Recv message");
rc = recv(client_sd, buf, sizeof(buf), 0);
if (rc == -1) {
test_fail("recv() failed unexpectedly");
kill(pid, SIGKILL);
return;
}
debug("[server] we got the following message:");
debug(buf);
for (i = 0; i < rc && i < 127; i++) {
buf[i] = toupper(buf[i]);
}
debug("[server] Sending message...");
rc = send(client_sd, buf, sizeof(buf), 0);
if (rc == -1) {
test_fail("send(client_sd, buf, sizeof(buf), 0) failed");
kill(pid, SIGKILL);
return;
}
if (rc < strlen((char *)buf)) {
test_fail("[server] write didn't write all the bytes");
}
memset(&buf, '\0', sizeof(buf));
debug("[server] Recvfrom message");
rc = recvfrom(client_sd, buf, sizeof(buf), 0, NULL, 0);
if (rc == -1) {
test_fail("recvfrom() failed unexpectedly");
kill(pid, SIGKILL);
return;
}
debug("[server] we got the following message:");
debug(buf);
for (i = 0; i < rc && i < 127; i++) {
buf[i] = toupper(buf[i]);
}
debug("[server] Sendto message...");
rc = sendto(client_sd, buf, sizeof(buf), 0, NULL, 0);
if (rc == -1) {
test_fail("sendto() failed");
kill(pid, SIGKILL);
return;
}
if (rc < strlen((char *)buf)) {
test_fail("[server] write didn't write all the bytes");
}
shutdown(client_sd, SHUT_RDWR);
CLOSE(client_sd);
shutdown(sd, SHUT_RDWR);
CLOSE(sd);
/* wait for client to exit */
do {
errno = 0;
rc = waitpid(pid, &status, 0);
} while (rc == -1 && errno == EINTR);
/* we use the exit status to get its error count */
errct += WEXITSTATUS(status);
}
int server_ready = 0;
/* signal handler for the client */
void test_xfer_sighdlr(int sig)
{
debug("entering signal handler");
switch (sig) {
/* the server will send SIGUSR1 when it is time for us
* to start the tests
*/
case SIGUSR1:
server_ready = 1;
debug("got SIGUSR1, the server is ready for the client");
break;
default:
debug("didn't get SIGUSR1");
}
debug("leaving signal handler");
}
/*
* A toupper() client.
*/
static void test_xfer_client(const struct socket_test_info *info)
{
struct timeval tv;
fd_set readfds;
struct sockaddr_storage peer_addr;
socklen_t peer_addr_len;
int sd;
int rc;
char buf[BUFSIZE];
debug("[client] entering test_xfer_client()");
errct = 0; /* reset error count */
memset(&buf, '\0', sizeof(buf));
while (server_ready == 0) {
debug("[client] waiting for the server to signal");
sleep(1);
}
peer_addr_len = sizeof(peer_addr);
if (info->callback_xfer_prepclient) info->callback_xfer_prepclient();
debug("[client] creating client socket");
SOCKET(sd, info->domain, info->type, 0);
debug("[client] connecting to server through the symlink");
rc = connect(sd, info->clientaddrsym, info->clientaddrsymlen);
if (rc == -1) {
test_fail("[client] connect() should have worked");
} else {
debug("[client] connected");
}
debug("[client] testing getpeername()");
memset(&peer_addr, '\0', sizeof(peer_addr));
rc = getpeername(sd, (struct sockaddr *) &peer_addr, &peer_addr_len);
if (rc == -1) {
test_fail("[client] getpeername() should have worked");
}
info->callback_check_sockaddr((struct sockaddr *) &peer_addr,
peer_addr_len, "getpeername", 1);
strncpy(buf, "Hello, World!", sizeof(buf) - 1);
debug("[client] send to server");
rc = write(sd, buf, sizeof(buf));
if (rc == -1) {
test_fail("[client] write() failed unexpectedly");
}
memset(buf, '\0', sizeof(buf));
debug("[client] read from server");
rc = read(sd, buf, sizeof(buf));
if (rc == -1) {
test_fail("[client] read() failed unexpectedly");
} else {
debug("[client] we got the following message:");
debug(buf);
}
if (strncmp(buf, "HELLO, WORLD!", sizeof(buf)) != 0) {
test_fail("[client] We didn't get the correct response");
}
memset(&buf, '\0', sizeof(buf));
strncpy(buf, "Bonjour!", sizeof(buf) - 1);
debug("[client] send to server");
rc = send(sd, buf, sizeof(buf), 0);
if (rc == -1) {
test_fail("[client] send() failed unexpectedly");
}
if (info->callback_xfer_peercred) info->callback_xfer_peercred(sd);
debug("Testing select()");
tv.tv_sec = 2;
tv.tv_usec = 500000;
FD_ZERO(&readfds);
FD_SET(sd, &readfds);
rc = select(sd + 1, &readfds, NULL, NULL, &tv);
if (rc == -1) {
test_fail("[client] select() should not have failed");
}
if (rc != 1) {
test_fail("[client] select() should have returned 1");
}
if (!(FD_ISSET(sd, &readfds))) {
test_fail("The server didn't respond within 2.5 seconds");
}
memset(buf, '\0', sizeof(buf));
debug("[client] recv from server");
rc = recv(sd, buf, sizeof(buf), 0);
if (rc == -1) {
test_fail("[client] recv() failed unexpectedly");
} else {
debug("[client] we got the following message:");
debug(buf);
}
if (strncmp(buf, "BONJOUR!", sizeof(buf)) != 0) {
test_fail("[client] We didn't get the right response.");
}
memset(&buf, '\0', sizeof(buf));
strncpy(buf, "Hola!", sizeof(buf) - 1);
debug("[client] sendto to server");
rc = sendto(sd, buf, sizeof(buf), 0, NULL, 0);
if (rc == -1) {
test_fail("[client] sendto() failed");
}
0