commandtest.c 17.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
/*
 * commandtest.c: Test the libCommand API
 *
 * Copyright (C) 2010 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 */

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/stat.h>
#include <fcntl.h>

#include "testutils.h"
#include "internal.h"
#include "nodeinfo.h"
#include "util.h"
#include "memory.h"
#include "command.h"
#include "files.h"

#ifdef WIN32

static int
mymain(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
    exit (EXIT_AM_SKIP);
}

#else

static char *progname;
static char *abs_srcdir;


53 54
static int checkoutput(const char *testname)
{
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
    int ret = -1;
    char cwd[1024];
    char *expectname = NULL;
    char *expectlog = NULL;
    char *actualname = NULL;
    char *actuallog = NULL;

    if (!getcwd(cwd, sizeof(cwd)))
        return -1;

    if (virAsprintf(&expectname, "%s/commanddata/%s.log", abs_srcdir,
                    testname) < 0)
        goto cleanup;
    if (virAsprintf(&actualname, "%s/commandhelper.log", abs_builddir) < 0)
        goto cleanup;

    if (virFileReadAll(expectname, 1024*64, &expectlog) < 0) {
        fprintf(stderr, "cannot read %s\n", expectname);
        goto cleanup;
    }

    if (virFileReadAll(actualname, 1024*64, &actuallog) < 0) {
        fprintf(stderr, "cannot read %s\n", actualname);
        goto cleanup;
    }

    if (STRNEQ(expectlog, actuallog)) {
        virtTestDifference(stderr, expectlog, actuallog);
        goto cleanup;
    }

    ret = 0;

cleanup:
E
Eric Blake 已提交
89
    unlink(actualname);
90 91 92 93 94 95 96 97 98 99 100 101
    VIR_FREE(actuallog);
    VIR_FREE(actualname);
    VIR_FREE(expectlog);
    VIR_FREE(expectname);
    return ret;
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 * No slot for return status must log error.
 */
102 103
static int test0(const void *unused ATTRIBUTE_UNUSED)
{
104 105 106 107 108 109
    virCommandPtr cmd;
    int ret = -1;

    cmd = virCommandNew(abs_builddir "/commandhelper-doesnotexist");
    if (virCommandRun(cmd, NULL) == 0)
        goto cleanup;
110 111

    if (virGetLastError() == NULL)
112
        goto cleanup;
113

114 115 116 117 118 119 120 121 122 123 124 125 126
    virResetLastError();
    ret = 0;

cleanup:
    virCommandFree(cmd);
    return ret;
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 * Capturing return status must not log error.
 */
127 128
static int test1(const void *unused ATTRIBUTE_UNUSED)
{
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
    virCommandPtr cmd;
    int ret = -1;
    int status;

    cmd = virCommandNew(abs_builddir "/commandhelper-doesnotexist");
    if (virCommandRun(cmd, &status) < 0)
        goto cleanup;
    if (status == 0)
        goto cleanup;
    ret = 0;

cleanup:
    virCommandFree(cmd);
    return ret;
}

/*
 * Run program (twice), no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 */
149 150
static int test2(const void *unused ATTRIBUTE_UNUSED)
{
151 152 153 154 155 156
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    int ret;

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
157
        virCommandFree(cmd);
158 159 160 161 162 163 164 165 166 167 168
        return -1;
    }

    if ((ret = checkoutput("test2")) != 0) {
        virCommandFree(cmd);
        return ret;
    }

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
169
        virCommandFree(cmd);
170 171 172 173 174 175 176 177 178 179 180 181
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test2");
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * stdin/out/err + two extra FD open
 */
182 183
static int test3(const void *unused ATTRIBUTE_UNUSED)
{
184 185 186 187
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    int newfd1 = dup(STDERR_FILENO);
    int newfd2 = dup(STDERR_FILENO);
    int newfd3 = dup(STDERR_FILENO);
E
Eric Blake 已提交
188
    int ret = -1;
189 190 191 192 193 194 195

    virCommandPreserveFD(cmd, newfd1);
    virCommandTransferFD(cmd, newfd3);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
196
        goto cleanup;
197 198 199 200 201 202
    }

    if (fcntl(newfd1, F_GETFL) < 0 ||
        fcntl(newfd2, F_GETFL) < 0 ||
        fcntl(newfd3, F_GETFL) >= 0) {
        puts("fds in wrong state");
E
Eric Blake 已提交
203
        goto cleanup;
204 205
    }

E
Eric Blake 已提交
206 207 208
    ret = checkoutput("test3");

cleanup:
209 210 211
    virCommandFree(cmd);
    VIR_FORCE_CLOSE(newfd1);
    VIR_FORCE_CLOSE(newfd2);
E
Eric Blake 已提交
212
    return ret;
213 214 215 216 217 218 219 220
}


/*
 * Run program, no args, inherit all ENV, CWD is /
 * Only stdin/out/err open.
 * Daemonized
 */
221 222
static int test4(const void *unused ATTRIBUTE_UNUSED)
{
223 224
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    char *pidfile = virFilePid(abs_builddir, "commandhelper");
E
Eric Blake 已提交
225 226 227 228 229
    pid_t pid;
    int ret = -1;

    if (!pidfile)
        goto cleanup;
230 231 232 233 234 235 236

    virCommandSetPidFile(cmd, pidfile);
    virCommandDaemonize(cmd);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
237
        goto cleanup;
238 239 240 241
    }

    if (virFileReadPid(abs_builddir, "commandhelper", &pid) != 0) {
        printf("cannot read pidfile\n");
E
Eric Blake 已提交
242
        goto cleanup;
243 244 245 246
    }
    while (kill(pid, 0) != -1)
        usleep(100*1000);

E
Eric Blake 已提交
247
    ret = checkoutput("test4");
248

E
Eric Blake 已提交
249 250
cleanup:
    virCommandFree(cmd);
E
Eric Blake 已提交
251
    unlink(pidfile);
252
    VIR_FREE(pidfile);
E
Eric Blake 已提交
253
    return ret;
254 255 256 257 258 259 260
}


/*
 * Run program, no args, inherit filtered ENV, keep CWD.
 * Only stdin/out/err open
 */
261 262
static int test5(const void *unused ATTRIBUTE_UNUSED)
{
263 264 265 266 267 268 269
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

    virCommandAddEnvPassCommon(cmd);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
270
        virCommandFree(cmd);
271 272 273 274 275 276 277 278 279 280 281 282 283
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test5");
}


/*
 * Run program, no args, inherit filtered ENV, keep CWD.
 * Only stdin/out/err open
 */
284 285
static int test6(const void *unused ATTRIBUTE_UNUSED)
{
286 287 288 289 290 291 292 293
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

    virCommandAddEnvPass(cmd, "DISPLAY");
    virCommandAddEnvPass(cmd, "DOESNOTEXIST");

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
294
        virCommandFree(cmd);
295 296 297 298 299 300 301 302 303 304 305 306 307
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test6");
}


/*
 * Run program, no args, inherit filtered ENV, keep CWD.
 * Only stdin/out/err open
 */
308 309
static int test7(const void *unused ATTRIBUTE_UNUSED)
{
310 311 312 313 314 315 316 317 318
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

    virCommandAddEnvPassCommon(cmd);
    virCommandAddEnvPass(cmd, "DISPLAY");
    virCommandAddEnvPass(cmd, "DOESNOTEXIST");

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
319
        virCommandFree(cmd);
320 321 322 323 324 325 326 327 328 329 330 331
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test7");
}

/*
 * Run program, no args, inherit filtered ENV, keep CWD.
 * Only stdin/out/err open
 */
332 333
static int test8(const void *unused ATTRIBUTE_UNUSED)
{
334 335 336 337 338 339 340 341
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

    virCommandAddEnvString(cmd, "LANG=C");
    virCommandAddEnvPair(cmd, "USER", "test");

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
342
        virCommandFree(cmd);
343 344 345 346 347 348 349 350 351 352 353 354 355
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test8");
}


/*
 * Run program, some args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 */
356 357
static int test9(const void *unused ATTRIBUTE_UNUSED)
{
358 359 360 361 362 363 364 365 366 367 368
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    const char* const args[] = { "arg1", "arg2", NULL };

    virCommandAddArg(cmd, "-version");
    virCommandAddArgPair(cmd, "-log", "bar.log");
    virCommandAddArgSet(cmd, args);
    virCommandAddArgList(cmd, "arg3", "arg4", NULL);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
369
        virCommandFree(cmd);
370 371 372 373 374 375 376 377 378 379 380 381 382
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test9");
}


/*
 * Run program, some args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 */
383 384
static int test10(const void *unused ATTRIBUTE_UNUSED)
{
385 386 387 388 389 390 391 392 393 394
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    const char *const args[] = {
        "-version", "-log=bar.log", NULL,
    };

    virCommandAddArgSet(cmd, args);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
395
        virCommandFree(cmd);
396 397 398 399 400 401 402 403 404 405 406 407
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test10");
}

/*
 * Run program, some args, inherit all ENV, keep CWD.
 * Only stdin/out/err open
 */
408 409
static int test11(const void *unused ATTRIBUTE_UNUSED)
{
410 411 412 413 414 415 416 417 418
    const char *args[] = {
        abs_builddir "/commandhelper",
        "-version", "-log=bar.log", NULL,
    };
    virCommandPtr cmd = virCommandNewArgs(args);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
419
        virCommandFree(cmd);
420 421 422 423 424 425 426 427 428 429 430 431
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test11");
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open. Set stdin data
 */
432 433
static int test12(const void *unused ATTRIBUTE_UNUSED)
{
434 435 436 437 438 439 440
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

    virCommandSetInputBuffer(cmd, "Hello World\n");

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
441
        virCommandFree(cmd);
442 443 444 445 446 447 448 449 450 451 452 453
        return -1;
    }

    virCommandFree(cmd);

    return checkoutput("test12");
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open. Set stdin data
 */
454 455
static int test13(const void *unused ATTRIBUTE_UNUSED)
{
456 457 458 459 460 461 462 463 464 465 466 467 468
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    char *outactual = NULL;
    const char *outexpect = "BEGIN STDOUT\n"
        "Hello World\n"
        "END STDOUT\n";
    int ret = -1;

    virCommandSetInputBuffer(cmd, "Hello World\n");
    virCommandSetOutputBuffer(cmd, &outactual);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
469
        goto cleanup;
470
    }
E
Eric Blake 已提交
471 472
    if (!outactual)
        goto cleanup;
473 474

    virCommandFree(cmd);
E
Eric Blake 已提交
475
    cmd = NULL;
476 477 478 479 480 481

    if (!STREQ(outactual, outexpect)) {
        virtTestDifference(stderr, outactual, outexpect);
        goto cleanup;
    }

E
Eric Blake 已提交
482
    ret = checkoutput("test13");
483 484

cleanup:
E
Eric Blake 已提交
485
    virCommandFree(cmd);
486 487 488 489 490 491 492 493
    VIR_FREE(outactual);
    return ret;
}

/*
 * Run program, no args, inherit all ENV, keep CWD.
 * Only stdin/out/err open. Set stdin data
 */
494 495
static int test14(const void *unused ATTRIBUTE_UNUSED)
{
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
    char *outactual = NULL;
    const char *outexpect = "BEGIN STDOUT\n"
        "Hello World\n"
        "END STDOUT\n";
    char *erractual = NULL;
    const char *errexpect = "BEGIN STDERR\n"
        "Hello World\n"
        "END STDERR\n";
    int ret = -1;

    virCommandSetInputBuffer(cmd, "Hello World\n");
    virCommandSetOutputBuffer(cmd, &outactual);
    virCommandSetErrorBuffer(cmd, &erractual);

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
E
Eric Blake 已提交
514
        goto cleanup;
515
    }
E
Eric Blake 已提交
516 517
    if (!outactual || !erractual)
        goto cleanup;
518 519

    virCommandFree(cmd);
E
Eric Blake 已提交
520
    cmd = NULL;
521 522 523 524 525 526 527 528 529 530

    if (!STREQ(outactual, outexpect)) {
        virtTestDifference(stderr, outactual, outexpect);
        goto cleanup;
    }
    if (!STREQ(erractual, errexpect)) {
        virtTestDifference(stderr, erractual, errexpect);
        goto cleanup;
    }

E
Eric Blake 已提交
531
    ret = checkoutput("test14");
532 533

cleanup:
E
Eric Blake 已提交
534
    virCommandFree(cmd);
535 536 537 538 539 540 541 542 543 544
    VIR_FREE(outactual);
    VIR_FREE(erractual);
    return ret;
}


/*
 * Run program, no args, inherit all ENV, change CWD.
 * Only stdin/out/err open
 */
545 546
static int test15(const void *unused ATTRIBUTE_UNUSED)
{
547
    virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
548 549
    char *cwd = NULL;
    int ret = -1;
550

551 552 553
    if (virAsprintf(&cwd, "%s/commanddata", abs_srcdir) < 0)
        goto cleanup;
    virCommandSetWorkingDirectory(cmd, cwd);
554 555 556 557

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
558
        goto cleanup;
559 560
    }

561 562 563 564
    ret = checkoutput("test15");

cleanup:
    VIR_FREE(cwd);
565 566
    virCommandFree(cmd);

567
    return ret;
568 569 570 571 572
}

/*
 * Don't run program; rather, log what would be run.
 */
573 574
static int test16(const void *unused ATTRIBUTE_UNUSED)
{
575 576 577 578 579 580 581 582 583 584 585 586
    virCommandPtr cmd = virCommandNew("/bin/true");
    char *outactual = NULL;
    const char *outexpect = "A=B /bin/true C";
    int ret = -1;
    int fd = -1;

    virCommandAddEnvPair(cmd, "A", "B");
    virCommandAddArg(cmd, "C");

    if ((outactual = virCommandToString(cmd)) == NULL) {
        virErrorPtr err = virGetLastError();
        printf("Cannot convert to string: %s\n", err->message);
E
Eric Blake 已提交
587
        goto cleanup;
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
    }
    if ((fd = open(abs_builddir "/commandhelper.log",
                   O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0) {
        printf("Cannot open log file: %s\n", strerror (errno));
        goto cleanup;
    }
    virCommandWriteArgLog(cmd, fd);
    if (VIR_CLOSE(fd) < 0) {
        printf("Cannot close log file: %s\n", strerror (errno));
        goto cleanup;
    }

    if (!STREQ(outactual, outexpect)) {
        virtTestDifference(stderr, outactual, outexpect);
        goto cleanup;
    }
E
Eric Blake 已提交
604 605

    ret = checkoutput("test16");
606 607

cleanup:
E
Eric Blake 已提交
608
    virCommandFree(cmd);
609 610 611 612 613
    VIR_FORCE_CLOSE(fd);
    VIR_FREE(outactual);
    return ret;
}

614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
/*
 * Test string handling when no output is present.
 */
static int test17(const void *unused ATTRIBUTE_UNUSED)
{
    virCommandPtr cmd = virCommandNew("/bin/true");
    int ret = -1;
    char *outbuf;
    char *errbuf;

    virCommandSetOutputBuffer(cmd, &outbuf);
    if (outbuf != NULL) {
        puts("buffer not sanitized at registration");
        goto cleanup;
    }

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
        goto cleanup;
    }

    if (!outbuf || *outbuf) {
        puts("output buffer is not an allocated empty string");
        goto cleanup;
    }
    VIR_FREE(outbuf);
    if ((outbuf = strdup("should not be leaked")) == NULL) {
        puts("test framework failure");
        goto cleanup;
    }

    virCommandSetErrorBuffer(cmd, &errbuf);
    if (errbuf != NULL) {
        puts("buffer not sanitized at registration");
        goto cleanup;
    }

    if (virCommandRun(cmd, NULL) < 0) {
        virErrorPtr err = virGetLastError();
        printf("Cannot run child %s\n", err->message);
        goto cleanup;
    }

    if (!outbuf || *outbuf || !errbuf || *errbuf) {
        puts("output buffers are not allocated empty strings");
        goto cleanup;
    }

    ret = 0;
cleanup:
    virCommandFree(cmd);
    VIR_FREE(outbuf);
    VIR_FREE(errbuf);
    return ret;
}

671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
static int
mymain(int argc, char **argv)
{
    int ret = 0;
    char cwd[PATH_MAX];

    abs_srcdir = getenv("abs_srcdir");
    if (!abs_srcdir)
        abs_srcdir = getcwd(cwd, sizeof(cwd));

    progname = argv[0];

    if (argc > 1) {
        fprintf(stderr, "Usage: %s\n", progname);
        return(EXIT_FAILURE);
    }

    if (chdir("/tmp") < 0)
        return(EXIT_FAILURE);

691 692 693 694 695 696
    /* Kill off any inherited fds that might interfere with our
     * testing.  */
    close(3);
    close(4);
    close(5);

697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
    virInitialize();

    const char *const newenv[] = {
        "PATH=/usr/bin:/bin",
        "HOSTNAME=test",
        "LANG=C",
        "HOME=/home/test",
        "USER=test",
        "LOGNAME=test"
        "TMPDIR=/tmp",
        "DISPLAY=:0.0",
        NULL
    };
    environ = (char **)newenv;

# define DO_TEST(NAME)                                                \
    if (virtTestRun("Command Exec " #NAME " test",                    \
                    1, NAME, NULL) < 0)                               \
        ret = -1

    DO_TEST(test0);
    DO_TEST(test1);
    DO_TEST(test2);
    DO_TEST(test3);
    DO_TEST(test4);
    DO_TEST(test5);
    DO_TEST(test6);
    DO_TEST(test7);
    DO_TEST(test8);
    DO_TEST(test9);
    DO_TEST(test10);
    DO_TEST(test11);
    DO_TEST(test12);
    DO_TEST(test13);
    DO_TEST(test14);
    DO_TEST(test15);
    DO_TEST(test16);
734
    DO_TEST(test17);
735 736 737 738 739 740 741

    return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}

#endif /* !WIN32 */

VIRT_TEST_MAIN(mymain)