From 36e0c88e7a3912c8a2e6594841172adb9c14525b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 8 Apr 2017 14:14:26 +0200 Subject: Implement machine enumeration --- tests/agent/testscript | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 tests/agent/testscript (limited to 'tests/agent/testscript') diff --git a/tests/agent/testscript b/tests/agent/testscript new file mode 100644 index 0000000..fa465a4 --- /dev/null +++ b/tests/agent/testscript @@ -0,0 +1,112 @@ +# file : tests/agent/testscript +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# The /build/machines directory should be on a btrfs filesystem and have the +# following layout and contents: +# +# /build/machines/ +# └── default/ +# └── linux-gcc/ +# ├── linux-gcc-1.0/ +# │ └── manifest +# └── linux-gcc-1.1/ +# └── manifest +# +# Notes: +# +# - The test must be run serially (@@ TODO: serial directive) + +test.options = --verbose 2 +test.arguments = stage 1 + +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 + + +$cp + + : no-current-machine-symlink + : + $* 123 2>>"EOE" + trace: enumerate_machines: skipping $m/: no subvolume link + EOE + + ln -T -s linux-gcc-1.0 $m/linux-gcc-1 + + : bootstrap + : + $* 123 >>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/ + EOE + + ln -T -f -s linux-gcc-1.1 $m/linux-gcc-1 + + : re-bootstrap-machine + : + $* 123 >>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 + EOE + + : re-bootstrap-toolchain + : + $* 124 >>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 + EOE + + sed -i -e 's/^(bbot-version):.*/\1: 0/' $m/linux-gcc-stage/manifest + + : re-bootstrap-bbot + : + $* 124 >>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 + EOE + + sed -i -e 's/^(bbot-version):.*/\1: 99999900/' $m/linux-gcc-stage/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-\\.+% + EOE + + -$rm +} -- cgit v1.1