From f82cfb156aec7c26d9aaee76e1d2755680aa84eb Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 4 Feb 2016 15:45:23 +1100 Subject: [PATCH] Fix tar listing in functional tests I noticed when running functional tests via a interactive shell they would end up hanging; I tracked it down to waiting for input on this tar command. We need to specify "-f" so it opens the file ... --- | + tar -t /tmp/tmp.qid2Ygfu7v/image.tar | + grep -q /tmp/dib-test-should-fail | tar: This does not look like a tar archive | tar: /tmp/tmp.qid2Ygfu7v/image.tar: Not found in archive | tar: Exiting with failure status due to previous errors --- I guess we never noticed because it's always running in CI where stdin is closed and it just get that nothing read above. This probably was reversing the logic of the "should have failed" tests ... but I don't think we take that path currently for any tests. Change-Id: Idad2c172797395d45c0d750ec687011cc1fbf52a --- tests/test_functions.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_functions.bash b/tests/test_functions.bash index 6397d088..37344ed8 100644 --- a/tests/test_functions.bash +++ b/tests/test_functions.bash @@ -64,7 +64,7 @@ function run_disk_element_test() { echo "No image $dest_dir/image.tar found!" exit 1 else - if tar -t $dest_dir/image.tar | grep -q /tmp/dib-test-should-fail; then + if tar -tf $dest_dir/image.tar | grep -q /tmp/dib-test-should-fail; then echo "Error: Element: $element, test-element $test_element should have failed, but passed." exit 1 else