Fork us on GitHub Follow us on Google+ Follow us on Facebook Follow us on Twitter

Changes between Version 1 and Version 2 of TestInVM


Ignore:
Timestamp:
2018-11-17T21:13:28Z (4 weeks ago)
Author:
Vojtech Horky
Comment:

How to run test-in-vm.py

Legend:

Unmodified
Added
Removed
Modified
  • TestInVM

    v1 v2  
    11= Automated testing of HelenOS in a virtual machine
    22
    3 Part of HelenOS [wiki:CI continuous testing] are also tests that are executed inside HelenOS. That is, we launch a VM (QEMU or MSIM at the moment) and check that command executed inside HelenOS gives the expected output. This page contains a brief overview of how to write such tests and how to run them.
     3Part of HelenOS [wiki:CI continuous testing] are also tests that are executed inside HelenOS. That is, we launch a VM (QEMU or MSIM at the moment) and check that command executed inside HelenOS gives the expected output. This page contains a brief overview of how to write such testing scenarios and how to run them.
     4
     5
     6== Prerequisites
     7
     8For this to work, you need to have Python 3, QEMU, ImageMagick (i.e. `convert` command) and SED. For testing on mips32, you will also need MSIM, Xvfb (or Xephyr), xterm and xdotool.
    49
    510
    611== test-in-vm.py
    712
    8 The testing script is in the root of the [https://github.com/HelenOS/ci CI] repository. To try it, prepare a HelenOS image (or grab one from [http://ci.helenos.org/latest/ ci.helenos.org]) for one of the supported architectures. Here, we will assume you have downloaded [http://ci.helenos.org/latest/amd64/helenos-amd64-with-binutils-pcc.iso HelenOS with binutils and PCC for amd64] into `helenos-amd64-with-binutils-pcc.iso`.
     13The testing script is in the root of the [https://github.com/HelenOS/ci CI] repository. To try it, prepare a HelenOS image (or grab one from [http://ci.helenos.org/latest/ ci.helenos.org]) for one of the supported architectures. Here, we will assume you have downloaded [http://ci.helenos.org/latest/amd64/helenos-amd64-with-binutils-pcc.iso HelenOS with binutils and PCC for amd64] into `helenos-amd64-with-binutils-pcc.iso` into clone of CI repository.
    914
     15For this image, we choose to run a scenario where we compile and run a Hello, World! program written in C. Scenarios are located under `scenarios` folder in CI repository, their format will be described later on.
     16
     17To actually run the scenario, we launch the `test-in-vm.py` script and specify path to the boot image, architecture and path to the scenario. Advanced options will be described later.
     18
     19{{{
     20./test-in-vm.py \
     21    --arch amd64 \
     22    --image helenos-amd64-with-binutils-pcc.iso \
     23    --scenario scenarios/coast/pcc/hello.yml
     24}}}
     25
     26When you run this script, you will see that it starts QEMU with HelenOS and waits until the terminal appears. Then it automatically types commands that compiles `hello.c` and launches the compiled `a.out` binary. QEMU is then terminated and if all went okay, we will see a message about successful pass of the scenario (or error message explaining the reason for failure).
     27