travis.yml: Enable running of tests with TCG
PATCH 1/1 travis.yml: Enable running of tests with TCG
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.
--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
.travis.yml +18 -1
@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir" + TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308" + ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run" before_script: - mkdir -p $BUILD_DIR && cd $BUILD_DIR
@@ -45,4 +61,5 @@ before_script: - if [ -e ../configure ]; then ../configure $CONFIG ; fi script: - make -j3 - - ./run_tests.sh || true + - ACCEL="${ACCEL:-tcg}" ./run_tests.sh -v $TESTS | tee results.txt + - if grep -q FAIL results.txt ; then exit 1 ; fi
Signature · 1 line
2.18.1
Quoted 49 lines · Thomas Huth
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.Signed-off-by Thomas Huth <[email protected]>--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-).travis.yml +10
-0@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir"
.travis.yml env: · line 56
Quoted 10 lines
.travis.yml +6
-0+ TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308" + ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run"
What about the other s390x tests? (is the QEMU binary too old to make them pass?)
The issue with TCG is that you can easily get false negatives in case the QEMU binary changes (e.g., new Ubuntu release).
"to make sure that the binaries are not completely broken" - while I understand the intuition behind that, I wonder if this is relevant in practice (especially, somebody committing changes without testing them, especially, under KVM). As long as the false negatives here don't hurt, I guess this change is fine.
Quoted 11 lines
.travis.yml +2
-1before_script: - mkdir -p $BUILD_DIR && cd $BUILD_DIR@@ -45,4 +61,5 @@ before_script: - if [ -e ../configure ]; then ../configure $CONFIG ; fi script: - make -j3 - - ./run_tests.sh || true + - ACCEL="${ACCEL:-tcg}" ./run_tests.sh -v $TESTS | tee results.txt + - if grep -q FAIL results.txt ; then exit 1 ; fi
Signature · 3 lines
Thanks, David / dhildenb
Quoted 55 lines · David Hildenbrand
Quoted 54 lines · Thomas Huth
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.Signed-off-by Thomas Huth <[email protected]>--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-).travis.yml +13
-0@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir" + TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308"
Quoted 8 lines
.travis.yml env: · line 56
Quoted 5 lines
.travis.yml +3
-0+ ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run"What about the other s390x tests? (is the QEMU binary too old to make them pass?)
Yes. All the others are failing.
Quoted 2 lines
The issue with TCG is that you can easily get false negatives in case the QEMU binary changes (e.g., new Ubuntu release).
That should not be a big deal, since the Ubuntu version is locked to a certain release in the travis.yml file. So we should not get a new version of QEMU by accident here, only if we explicitly update the "dist:" line in the yml file.
Quoted 3 lines
"to make sure that the binaries are not completely broken" - while I understand the intuition behind that, I wonder if this is relevant in practice
Well, the test coverage here is certainly far from being perfect, but it's still better than nothing. Imagine one of the patches changes common code in the lib/ folder and it only works on one architecture that the author tested. Chances are quite good that we detect that problem with this patch now.
Thomas
Quoted 65 lines · Thomas Huth
Quoted 55 lines · David Hildenbrand
Quoted 54 lines · Thomas Huth
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.Signed-off-by Thomas Huth <[email protected]>--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-).travis.yml +13
-0@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir" + TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308"Quoted 8 lines
.travis.yml env: · line 56
Quoted 5 lines
.travis.yml +3
-0+ ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run"What about the other s390x tests? (is the QEMU binary too old to make them pass?)
Quoted 1 line
Yes. All the others are failing.
So the QEMU versions is that old that not even the selftest works? :/ Is there a more recent distribution we can use?
Quoted 8 lines
Quoted 3 lines
The issue with TCG is that you can easily get false negatives in case the QEMU binary changes (e.g., new Ubuntu release).
That should not be a big deal, since the Ubuntu version is locked to a certain release in the travis.yml file. So we should not get a new version of QEMU by accident here, only if we explicitly update the "dist:" line in the yml file.
Or if the dist updates QEMU. Not sure how often that happens in QEMU. (but as not even the selfest passes, it cannot really get any worse :D )
Quoted 9 lines
Quoted 4 lines
"to make sure that the binaries are not completely broken" - while I understand the intuition behind that, I wonder if this is relevant in practice
Well, the test coverage here is certainly far from being perfect, but it's still better than nothing. Imagine one of the patches changes common code in the
lib/folder and it only works on one architecture that the author tested. Chances are quite good that we detect that problem with this patch now.
Better than nothing I guess.
Signature · 3 lines
Thanks, David / dhildenb
Quoted 66 lines · David Hildenbrand
Quoted 65 lines · Thomas Huth
Quoted 63 lines · David Hildenbrand
Quoted 49 lines · Thomas Huth
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.Signed-off-by Thomas Huth <[email protected]>--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-).travis.yml +10
-0@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir".travis.yml env: · line 56
Quoted 10 lines
.travis.yml +6
-0+ TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308" + ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run"What about the other s390x tests? (is the QEMU binary too old to make them pass?)
Quoted 4 lines
Quoted 1 line
Yes. All the others are failing.
So the QEMU versions is that old that not even the selftest works? :/ Is there a more recent distribution we can use?
I already tested with "dist: bionic", and that's all I've got to get working there. According to
https://docs.travis-ci.com/user/reference/overview/ there are no newer distros available yet.
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
The issue with TCG is that you can easily get false negatives in case the QEMU binary changes (e.g., new Ubuntu release).
That should not be a big deal, since the Ubuntu version is locked to a certain release in the travis.yml file. So we should not get a new version of QEMU by accident here, only if we explicitly update the "dist:" line in the yml file.
Or if the dist updates QEMU. Not sure how often that happens in QEMU. (but as not even the selfest passes, it cannot really get any worse :D )
I don't think that they will update the QEMU version during the life-cycle of a certain release - they likely only apply some bug fixes, which won't change much of the behavior here. Remember that qemu-system-s390x is almost completely broken in these Ubuntu versions since they do not ship the firmware image in the package. I only got something running by luck with that "firmware=..." trick.
Thomas
Quoted 64 lines · Thomas Huth
Currently the tests at the end of the .travis.yml script are ignored, since we can not use KVM in the Travis containers. But we can actually run of some of the kvm-unit-tests with TCG instead, to make sure that the binaries are not completely broken.
Thus introduce a new TESTS variable that lists the tests which we can run with TCG. Unfortunately, the ppc64 and s390x QEMUs in Ubuntu also need some extra love: The ppc64 version only works with the additional "cap-htm=off" setting. And the s390x package lacks the firmware and refuses to work unless we provide a fake firmware file here. Any file works since the firmware is skipped when "-kernel" is used, so we can simply use one of the pre-existing files in the source tree.Signed-off-by Thomas Huth <[email protected]>--- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-).travis.yml +16
-0@@ -20,24 +20,40 @@ env: matrix: - CONFIG="" BUILD_DIR="." + TESTS="vmexit_cpuid vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ipi + vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed" - CONFIG="" BUILD_DIR="x86-builddir" + TESTS="ioapic-split ioapic smptest smptest3 eventinj msr port80 syscall + tsc rmap_chain umip intel_iommu vmexit_inl_pmtimer vmexit_ipi_halt" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm --cross-prefix=arm-linux-gnueabihf-" BUILD_DIR="arm-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci selftest-setup" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="." + TESTS="selftest-vectors-kernel selftest-vectors-user selftest-smp" - CONFIG="--arch=arm64 --cross-prefix=aarch64-linux-gnu-" BUILD_DIR="arm64-buildir" + TESTS="pci-test pmu gicv2-active gicv3-active psci timer selftest-setup" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="." + TESTS="spapr_hcall emulator rtas-set-time-of-day" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=ppc64 --endian=little --cross-prefix=powerpc64le-linux-gnu-" BUILD_DIR="ppc64le-buildir" + TESTS="rtas-get-time-of-day rtas-get-time-of-day-base" + ACCEL="tcg,cap-htm=off" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="." + TESTS="diag10 diag308" + ACCEL="tcg,firmware=s390x/run" - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" BUILD_DIR="s390x-builddir" + TESTS="sieve" + ACCEL="tcg,firmware=s390x/run" before_script: - mkdir -p $BUILD_DIR && cd $BUILD_DIR
.travis.yml before_script: · line 65
Quoted 6 lines
.travis.yml +2
-1@@ -45,4 +61,5 @@ before_script: - if [ -e ../configure ]; then ../configure $CONFIG ; fi script: - make -j3 - - ./run_tests.sh || true + - ACCEL="${ACCEL:-tcg}" ./run_tests.sh -v $TESTS | tee results.txt + - if grep -q FAIL results.txt ; then exit 1 ; fi
Queued, thanks.
Paolo