From aec4f11d5c14e207adf71438d66912b64b57754a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 6 Nov 2015 14:03:01 +0000 Subject: Implement the first fast option checking test --- yarns/900-implements.yarn | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'yarns/900-implements.yarn') diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index e9e4ec7..72c8f2c 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -18,11 +18,11 @@ If `TESTS` is not set, everything gets run. Scenarios can use the ASSUMING statements defined here to let the user to allow them to run or not to run. - IMPLEMENTS ASSUMING build tests are requested - test_requested build + IMPLEMENTS ASSUMING (fast|build) tests are requested + test_requested "$MATCH_1" -## Building an image +## Building an image, or attempting to To keep individual steps shorter, we provide some steps to set common parts, such as the name of the image being built. @@ -40,6 +40,29 @@ but it's actually restricted to vmdebootstrap in the source tree. --size "$IMAGE_SIZE" \ $MATCH_1 +Attempt to run vmdebootstrap, but allow it it to fail. Capture exit +code and stderr. + + IMPLEMENTS WHEN user attempts to run vmdebootstrap (.*) + if PYTHONPATH="$SRCDIR" "$SRCDIR/bin/vmdebootstrap" \ + $MATCH_1 2> vmdebootstrap.stderr + then + echo 0 > vmdebootstrap.exit + else + echo $? > vmdebootstrap.exit + fi + +Check for whether the attempted vmdebootstrap run had the desired exit +code. + + IMPLEMENTS THEN vmdebootstrap exited with a non-zero exit code + grep -vFx 0 vmdebootstrap.exit + +Check the stderr of the attempted vmdebootstrap run. + + IMPLEMENTS THEN vmdebootstrap wrote an error message matching (.+) + grep -P -e "$MATCH_1" vmdebootstrap.stderr + ## Static tests on disk images -- cgit v1.2.1