From 0e2f76b6f0ecb4b4c00a4c8001843b3c54bc08ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Apr 2017 13:29:50 +0200 Subject: Finish agent and worker logic --- tests/agent/testscript | 119 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 35 deletions(-) (limited to 'tests/agent/testscript') diff --git a/tests/agent/testscript b/tests/agent/testscript index cf92ace..e864bf2 100644 --- a/tests/agent/testscript +++ b/tests/agent/testscript @@ -3,7 +3,7 @@ # license : TBC; see accompanying LICENSE file # The /build/machines directory should be on a btrfs filesystem and have the -# following layout and contents: +# following layout/contents: # # /build/machines/ # └── default/ @@ -17,25 +17,24 @@ # # - The test must be run serially (@@ TODO: serial directive) -test.options = --verbose 2 -test.arguments = stage 1 +test.options = --verbose 3 cp = $src_base/btrfs-cpdir -f /build/machines.orig /build/machines rm = $src_base/btrfs-rmdir /build/machines -#\ : dump-machines : { - m = /build/machines/default/linux-gcc - test.options += --dump-machines --fake-bootstrap + m = /build/machines/default/linux-gcc + u = https://example.org/?dummy + +$cp : no-current-machine-symlink : - $* 123 2>>"EOE" + $* --toolchain-id 123 $u 2>>"EOE" trace: enumerate_machines: skipping $m/: no subvolume link EOE @@ -43,91 +42,140 @@ rm = $src_base/btrfs-rmdir /build/machines : bootstrap : - $* 123 >>EOO 2>>~"%EOE%d" + $* --toolchain-id 123 $u >>EOO 2>>~"%EOE%d" : 1 id: linux-gcc-1.0 name: linux-gcc summary: Linux with GCC EOO - %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.0 $m/linux-gcc-stage-\\.+% - trace: enumerate_machines: bootstrapping $m/linux-gcc-stage/ + %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.0 $m/linux-gcc-default-\\.+% + trace: enumerate_machines: bootstrapping $m/linux-gcc-default/ + trace: enumerate_machines: bootstrapped linux-gcc EOE ln -T -f -s linux-gcc-1.1 $m/linux-gcc-1 : re-bootstrap-machine : - $* 123 >>EOO 2>>~"%EOE%d" + $* --toolchain-id 123 $u >>EOO 2>>~"%EOE%d" : 1 id: linux-gcc-1.1 name: linux-gcc summary: Linux with GCC EOO - %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-stage-\\.+% - trace: enumerate_machines: re-bootstrapping $m/linux-gcc-stage/: new machine - trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-stage ro false - trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-stage + %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-default-\\.+% + trace: enumerate_machines: re-bootstrapping $m/linux-gcc-default/: new machine + trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-default ro false + trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-default + trace: enumerate_machines: bootstrapped linux-gcc EOE : re-bootstrap-toolchain : - $* 124 >>EOO 2>>~"%EOE%d" + $* --toolchain-id 124 $u >>EOO 2>>~"%EOE%d" : 1 id: linux-gcc-1.1 name: linux-gcc summary: Linux with GCC EOO - %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-stage-\\.+% - trace: enumerate_machines: re-bootstrapping $m/linux-gcc-stage/: new toolchain - trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-stage ro false - trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-stage + %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-default-\\.+% + trace: enumerate_machines: re-bootstrapping $m/linux-gcc-default/: new toolchain + trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-default ro false + trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-default + trace: enumerate_machines: bootstrapped linux-gcc EOE - sed -i -e 's/^(bbot-version):.*/\1: 0/' $m/linux-gcc-stage/manifest + sed -i -e 's/^(bbot-version):.*/\1: 0/' $m/linux-gcc-default/manifest : re-bootstrap-bbot : - $* 124 >>EOO 2>>~"%EOE%d" + $* --toolchain-id 124 $u >>EOO 2>>~"%EOE%d" : 1 id: linux-gcc-1.1 name: linux-gcc summary: Linux with GCC EOO - %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-stage-\\.+% - trace: enumerate_machines: re-bootstrapping $m/linux-gcc-stage/: new bbot - trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-stage ro false - trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-stage + %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-default-\\.+% + trace: enumerate_machines: re-bootstrapping $m/linux-gcc-default/: new bbot + trace: enumerate_machines: btrfs property set -ts $m/linux-gcc-default ro false + trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-default + trace: enumerate_machines: bootstrapped linux-gcc EOE - sed -i -e 's/^(bbot-version):.*/\1: 99999900/' $m/linux-gcc-stage/manifest + sed -i -e 's/^(bbot-version):.*/\1: 99999900/' $m/linux-gcc-default/manifest : re-bootstrap-bbot-newer : - $* 124 2>>~"%EOE%d" - %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-stage-\\.+% - trace: enumerate_machines: ignoring $m/linux-gcc-stage/: old bbot - %trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-stage-\\.+% + $* --toolchain-id 124 $u 2>>~"%EOE%d" + %trace: enumerate_machines: btrfs subvolume snapshot $m/linux-gcc-1.1 $m/linux-gcc-default-\\.+% + trace: enumerate_machines: ignoring $m/linux-gcc-default/: old bbot + %trace: enumerate_machines: btrfs subvolume delete $m/linux-gcc-default-\\.+% EOE -$rm } -#\ - -: bootstrap +: dump-result : { + test.options += --fake-bootstrap --fake-build --fake-request - + m = /build/machines/default/linux-gcc + u = https://example.org/?dummy + + +$cp + +ln -T -s linux-gcc-1.0 $m/linux-gcc-1 + +$* --dump-machines --verbose 1 $u >- # Bootstrap. + + : no-machine + : + $* --dump-task $u <>~"%EOE%d" + : 1 + name: foo + version: 1.2.3 + repository: https://example.org/1/ + machine: windows-msvc + EOI + %trace: enumerate_machines:\\.*%* + error: task from $u for unknown machine windows-msvc + EOE + : result + : + $* --dump-result $u <>EOO 2>>~"%EOE%d" + : 1 + name: foo + version: 1.2.3 + repository: https://example.org/1/ + machine: linux-gcc + EOI + : 1 + name: foo + version: 1.2.3 + status: abort + EOO + %trace: enumerate_machines:\\.*%* + EOE + + -$rm +} + +#\ +: bootstrap +: +{ test.options += --dump-machines + m = /build/machines/default/linux-gcc + u = https://example.org/?dummy + +$cp ln -T -s linux-gcc-1.0 $m/linux-gcc-1 : bootstrap : - $* 123 >>EOO 2>>EOE #2>>~"%EOE%d" + $* $u >>EOO 2>>EOE #2>>~"%EOE%d" : 1 id: linux-gcc-1.0 name: linux-gcc @@ -137,3 +185,4 @@ rm = $src_base/btrfs-rmdir /build/machines #-$rm } +#\ -- cgit v1.1