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
This commit is contained in:
Ian Wienand 2016-02-04 15:45:23 +11:00
parent 4526cf23ec
commit f82cfb156a

View File

@ -64,7 +64,7 @@ function run_disk_element_test() {
echo "No image $dest_dir/image.tar found!" echo "No image $dest_dir/image.tar found!"
exit 1 exit 1
else 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." echo "Error: Element: $element, test-element $test_element should have failed, but passed."
exit 1 exit 1
else else