aboutsummaryrefslogtreecommitdiff
path: root/tests/worker/startup.test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-18 13:29:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-18 13:29:50 +0200
commit0e2f76b6f0ecb4b4c00a4c8001843b3c54bc08ad (patch)
tree3f0735a7b7e0be27823b23e24806fe9650548dc6 /tests/worker/startup.test
parent1804e3e8cf3b8f1bb14e197dada1697c40bed144 (diff)
Finish agent and worker logic
Diffstat (limited to 'tests/worker/startup.test')
-rw-r--r--tests/worker/startup.test101
1 files changed, 101 insertions, 0 deletions
diff --git a/tests/worker/startup.test b/tests/worker/startup.test
new file mode 100644
index 0000000..d13e6c5
--- /dev/null
+++ b/tests/worker/startup.test
@@ -0,0 +1,101 @@
+# file : tests/worker/startup.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : TBC; see accompanying LICENSE file
+
+# Note: requires TFTP server (see buildfile).
+
+test.options = --startup
+tftp = 127.0.0.1:55123/test
+
+: fail-download
+:
+$* --tftp-host "$tftp/$@" 2>>"EOE" &manifest != 0;
+ curl: \(68\) TFTP: File Not Found
+ error: unable to download task manifest from tftp://$tftp/$@/manifest: input/output error
+ EOE
+diff -u - manifest <<EOO
+ : 1
+ name: unknown
+ version: 0
+ status: abnormal
+ EOO
+
+: fail-manifest
+:
+cat <': 1' >=manifest;
+$* --tftp-host "$tftp/$@" 2>>"EOE" != 0;
+ error: invalid task manifest: manifest:2:1: no task package name specified
+ EOE
+diff -u - manifest <<EOO
+ : 1
+ name: unknown
+ version: 0
+ status: abnormal
+ EOO
+
+: fail-env-search
+:
+cat <<EOI >=manifest;
+ : 1
+ name: libhello
+ version: 1.2.3
+ repository: https://pkg.example.org/1/
+ machine: linux-gcc
+ EOI
+$* --environment $~ --tftp-host "$tftp/$@" 2>>"EOE" != 0;
+ error: no environment setup executable in $representation($~) for target ''
+ EOE
+diff -u - manifest <<EOO
+ : 1
+ name: libhello
+ version: 1.2.3
+ status: abnormal
+ EOO
+
+: fail-env-run
+:
+cat <<EOI >=x86_64-linux-gnu;
+ #!/bin/sh
+ echo "environment setup failed"
+ exit 1
+ EOI
+chmod ugo+x x86_64-linux-gnu;
+cat <<EOI >=manifest;
+ : 1
+ name: libhello
+ version: 1.2.3
+ repository: https://pkg.example.org/1/
+ machine: linux-gcc
+ target: x86_64-linux-gnu
+ EOI
+$* --environment $~ --tftp-host "$tftp/$@" 2>>"EOE" != 0;
+ environment setup failed
+ error: process $~/x86_64-linux-gnu terminated with non-zero exit code
+ EOE
+diff -u - manifest <<EOO
+ : 1
+ name: libhello
+ version: 1.2.3
+ status: abnormal
+ EOO
+
+: pass
+:
+cat <<EOI >=x86_64-linux-gnu;
+ #!/bin/sh
+ echo "$1"
+ echo "$2"
+ EOI
+chmod ugo+x x86_64-linux-gnu;
+cat <<EOI >=manifest;
+ : 1
+ name: libhello
+ version: 1.2.3
+ repository: https://pkg.example.org/1/
+ machine: linux-gcc
+ target: x86_64-linux-gnu
+ EOI
+$* --environment $~ --tftp-host "$tftp/$@" 2>>"EOE"
+ x86_64-linux-gnu
+ $0
+ EOE