From 022d5cb4f246809ce8d9a08d3499edd309ed26e7 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 29 Sep 2021 21:22:00 +0300 Subject: Add agent, worker, and dependency checksums to task/result manifests --- tests/manifest/result-request.testscript | 31 ++++++++++++++++++++++++++++++- tests/manifest/result.testscript | 21 ++++++++++++++++++++- tests/manifest/task-response.testscript | 31 +++++++++++++++++++++++++++++-- tests/manifest/task.testscript | 17 +++++++++++++++++ 4 files changed, 96 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/manifest/result-request.testscript b/tests/manifest/result-request.testscript index e2c4a94..6d0e5b1 100644 --- a/tests/manifest/result-request.testscript +++ b/tests/manifest/result-request.testscript @@ -14,10 +14,12 @@ test.options += -rq : 1 session: abcd challenge: YQo= + agent-checksum: 1 : name: libfoo version: 1.0 status: error + worker-checksum: 1 EOF : no-challenge @@ -25,10 +27,12 @@ test.options += -rq $* <>EOF : 1 session: abcd + agent-checksum: 1 : name: libfoo version: 1.0 status: error + worker-checksum: 1 EOF } @@ -51,6 +55,14 @@ test.options += -rq challenge: YQo= challenge: YQo= EOI + + : agent-checksum + : + $* <'stdin:3:1: error: result request agent checksum redefinition' == 1 + : 1 + agent-checksum: 1 + agent-checksum: 1 + EOI } : invalid @@ -76,6 +88,13 @@ test.options += -rq : 1 challenge: EOI + + : empty-agent-checksum + : + $* <'stdin:2:16: error: empty result request agent checksum' == 1 + : 1 + agent-checksum: + EOI } : unknown-name @@ -95,11 +114,21 @@ EOI challenge: YQo= EOI + + : agent-checksum + : + $* <'stdin:4:1: error: no result request agent checksum specified' == 1 + : 1 + session: abc + challenge: YQo= + EOI + : result : - $* <'stdin:4:1: error: result manifest expected' == 1 + $* <'stdin:5:1: error: result manifest expected' == 1 : 1 session: abc challenge: YQo= + agent-checksum: 1 EOI } diff --git a/tests/manifest/result.testscript b/tests/manifest/result.testscript index c530170..0a1511f 100644 --- a/tests/manifest/result.testscript +++ b/tests/manifest/result.testscript @@ -30,6 +30,8 @@ test.options += -r test line 1 test line 2 \ + worker-checksum: 1 + dependency-checksum: 12345 EOF : update-error @@ -49,6 +51,8 @@ test.options += -r update line 1 update line 2 \ + worker-checksum: 1 + dependency-checksum: 12345 EOF : early-abort @@ -106,12 +110,20 @@ test.options += -r configure-log: configured configure-log: configured EOI + + : worker-checksum + : + $* <'stdin:3:1: error: result worker checksum redefinition' == 1 + : 1 + worker-checksum: 1 + worker-checksum: 1 + EOI } : invalid : { - : name-empty + : empty-name : $* <'stdin:2:6: error: invalid result package name: length is less than two characters' == 1 : 1 @@ -181,6 +193,13 @@ test.options += -r update-log: log EOI } + + : empty-worker-checksum + : + $* <'stdin:2:17: error: empty result worker checksum' == 1 + : 1 + worker-checksum: + EOI } : unknown-name diff --git a/tests/manifest/task-response.testscript b/tests/manifest/task-response.testscript index d486dda..df63f70 100644 --- a/tests/manifest/task-response.testscript +++ b/tests/manifest/task-response.testscript @@ -18,6 +18,7 @@ test.options += -ts session: abcd challenge: cc6585375ef81898cc60791b11852e3d2ed9ebb82ebb0874010fe0e6f9ebdb73 result-url: https://cppget.org/?build-result + agent-checksum: 1 : name: libfoo version: 1.0 @@ -26,7 +27,7 @@ test.options += -ts target: x86_64-microsoft-win32-msvc14.0 EOF - : no-challenge + : no-optional : $* <>EOF : 1 @@ -75,12 +76,19 @@ test.options += -ts result-url: https://cppget.org/?build-result result-url: https://cppget.org/?build-result EOI + + : agent-checksum + : + $* <'stdin:3:1: error: task response agent checksum redefinition' == 1 + : 1 + agent-checksum: 1 + agent-checksum: 1 + EOI } : invalid : { - : challenge : { @@ -119,6 +127,25 @@ test.options += -ts EOI } + : agent-checksum + : + { + : empty + : + $* <'stdin:2:16: error: empty task response agent checksum' == 1 + : 1 + agent-checksum: + EOI + + : redundant + : + $* <'stdin:4:1: error: unexpected task response agent checksum' == 1 + : 1 + session: + agent-checksum: 1 + EOI + } + : task-unexpected : $* <'stdin:3:1: error: single task response manifest expected' == 1 diff --git a/tests/manifest/task.testscript b/tests/manifest/task.testscript index 704ca20..95a2b30 100644 --- a/tests/manifest/task.testscript +++ b/tests/manifest/task.testscript @@ -20,12 +20,14 @@ test.options += -t requires: host tests: foo-tests examples: foo-examples + dependency-checksum: 12345 machine: windows_10-msvc_14 target: x86_64-microsoft-win32-msvc14.0 environment: lld config: config.cc.coptions=/Z7 config.cc.loptions=/DEBUG warning-regex: '^warning: ' '^.+: warning: ' interactive: error + worker-checksum: 1 EOF : no-config-regex-environment @@ -244,6 +246,14 @@ test.options += -t interactive: error interactive: warning EOI + + : worker-checksum + : + $* <'stdin:3:1: error: task worker checksum redefinition' == 1 + : 1 + worker-checksum: 1 + worker-checksum: 1 + EOI } : invalid @@ -386,6 +396,13 @@ test.options += -t : 1 interactive: EOI + + : worker-checksum + : + $* <'stdin:2:17: error: empty task worker checksum' == 1 + : 1 + worker-checksum: + EOI } : unknown-name -- cgit v1.1