示例#1
0
def run_ros2_tests(qemu: boot_cheribsd.CheriBSDInstance,
                   _: argparse.Namespace) -> bool:
    boot_cheribsd.info("Running ROS2 tests")
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    qemu.checked_run("cd /source && sh -xe ./run-ros2-tests.sh",
                     timeout=240 * 60)
    return True
示例#2
0
def run_cheri_examples_tests(qemu: boot_cheribsd.QemuCheriBSDInstance,
                             args: argparse.Namespace) -> bool:
    if args.sysroot_dir is not None:
        boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    boot_cheribsd.info("Running tests for cheri-examples")

    return os.system("./tests/run_tests.sh") == 0
示例#3
0
def setup_qtwebkit_test_environment(qemu: boot_cheribsd.CheriBSDInstance,
                                    _: argparse.Namespace):
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    qemu.run("export ICU_DATA=/sysroot/usr/local/share/icu/60.0.1")
    qemu.run("export LANG=en_US.UTF-8")
    qemu.run("echo '<h1>Hello World!</h1>' > /tmp/helloworld.html")

    # mime database
    qemu.run("mkdir -p /usr/share/mime/packages")
    # old directory names:
    qemu.run("mkdir -p /usr/local/Qt-cheri/lib/fonts")
    qemu.run("ln -sf /usr/local/Qt-cheri /usr/local/Qt-mips")
    # New directory names:
    qemu.checked_run("ln -sf /usr/local/Qt-cheri /usr/local/mips")
    qemu.checked_run("ln -sf /usr/local/Qt-cheri /usr/local/cheri")
    qemu.checked_run(
        "cp /source/LayoutTests/resources/Ahem.ttf /usr/local/Qt-cheri/lib/fonts"
    )
    qemu.checked_run(
        "cp /source/LayoutTests/fast/writing-mode/resources/DroidSansFallback-reduced.ttf "
        "/usr/local/Qt-cheri/lib/fonts")
    qemu.checked_run("cp /build/mime.cache /usr/share/mime")
    qemu.checked_run(
        "cp /build/freedesktop.org.xml /usr/share/mime/packages/freedesktop.org.xml"
    )

    boot_cheribsd.success(
        "To debug crashes run: `sysctl kern.corefile=/build/%N.%P.core; sysctl kern.coredump=1`"
        " and then run CHERI gdb on the host system.")

    # copy the smaller files to /tmp to avoid the smbfs overhead
    qemu.checked_run("cp /build/bin/jsc.stripped /tmp/jsc")
    qemu.checked_run(
        "cp /build/bin/DumpRenderTree.stripped /tmp/DumpRenderTree")
def run_cheri_tests(qemu: boot_cheribsd.QemuCheriBSDInstance,
                    args: argparse.Namespace) -> bool:
    if args.sysroot_dir is not None:
        boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    boot_cheribsd.info("Running Lua tests on CHERI riscv64")

    return os.system("make copy-lua copy-exec-tests") == 0
示例#5
0
def run_qtbase_tests(qemu: boot_cheribsd.CheriBSDInstance, _: argparse.Namespace):
    print("Running qtbase tests")
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    boot_cheribsd.prepend_ld_library_path(qemu, "/build/lib")
    qemu.run("/build/tests/auto/corelib/tools/qarraydata/tst_qarraydata")
    qemu.run("/build/tests/auto/corelib/global/qtendian/tst_qtendian")
    # TODO: -o /path/to/file,xunitxml
    return True
def setup_qtbase_tests(qemu: boot_cheribsd.CheriBSDInstance,
                       args: argparse.Namespace):
    if args.junit_xml is None:
        args.junit_xml = Path(
            args.build_dir,
            ("junit-results-" +
             datetime.datetime.utcnow().strftime("%Y%m%d-%H%M%S") + ".xml"))
    else:
        args.junit_xml = Path(args.junit_xml)
    assert args.junit_xml.parent.exists(), args.junit_xml
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    boot_cheribsd.prepend_ld_library_path(qemu, "/build/lib")
    qemu.run("export QT_PLUGIN_PATH=/build/plugins")
示例#7
0
def run_simple_test(qemu: boot_cheribsd.QemuCheriBSDInstance,
                    args: argparse.Namespace) -> bool:
    if args.sysroot_dir is not None:
        boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    boot_cheribsd.info("Running tests")
    # TODO: copy over the logfile and enable coredumps?
    # Run tests with a two hour timeout:
    qemu.checked_run("cd '{}'".format(qemu.smb_dirs[0].in_target), timeout=10)
    qemu.checked_run(args.test_command,
                     timeout=args.test_timeout,
                     pretend_result=0,
                     ignore_cheri_trap=args.ignore_cheri_trap)
    return True
def run_libcxxrt_tests(qemu: boot_cheribsd.CheriBSDInstance,
                       _: argparse.Namespace) -> bool:
    boot_cheribsd.info("Running libcxxrt tests")
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)
    qemu.run("export LIBUNWIND_PRINT_UNWINDING=1", timeout=2)
    qemu.run("export LIBUNWIND_PRINT_APIS=1", timeout=2)
    qemu.run("export LIBUNWIND_PRINT_DWARF=1", timeout=2)
    # Copy the libunwind library to both MIPS and CHERI library dirs so that it is picked up
    qemu.checked_run("ln -sfv /libunwind/lib/libunwind.so* /usr/lib/")
    qemu.checked_run("ln -sfv /libunwind/lib/libunwind.so* /usr/libcheri/")

    qemu.checked_run("'/build/bin/cxxrt-test-static' -v")
    qemu.checked_run("'/build/bin/cxxrt-test-foreign-exceptions' -v")
    qemu.checked_run("'/build/bin/cxxrt-test-shared' -v")

    # Check the test binaries linked against libunwind
    qemu.checked_run("'/build/bin/cxxrt-test-libunwind-static' -v")
    qemu.checked_run("'/build/bin/cxxrt-test-libunwind-allstatic' -v")
    qemu.checked_run("'/build/bin/cxxrt-test-libunwind-shared' -v")
    return True
示例#9
0
def setup_juliet_test_environment(qemu: boot_cheribsd.CheriBSDInstance,
                                  args: argparse.Namespace):
    boot_cheribsd.set_ld_library_path_with_sysroot(qemu)