Browse code

Fix die_if_not_set tests

The "die_if_not_set" test has the LINENO as a positional argument.
The existing tests are not passing this in, so they are failing.

Along with this, remove the "-x" from the invocation and hide the
output of the tests that are expected to fail to avoid confusion.

Change-Id: Ibf6b9d7bb72b9f92831e1a90292ff8b0bec7faea

Ian Wienand authored on 2015/04/17 12:10:33
Showing 1 changed files
... ...
@@ -13,26 +13,26 @@ source $TOP/openrc
13 13
 
14 14
 echo "Testing die_if_not_set()"
15 15
 
16
-bash -cx "source $TOP/functions; X=`echo Y && true`; die_if_not_set X 'not OK'"
16
+bash -c "source $TOP/functions; X=`echo Y && true`; die_if_not_set $LINENO X 'not OK'"
17 17
 if [[ $? != 0 ]]; then
18 18
     echo "die_if_not_set [X='Y' true] Failed"
19 19
 else
20 20
     echo 'OK'
21 21
 fi
22 22
 
23
-bash -cx "source $TOP/functions; X=`true`; die_if_not_set X 'OK'"
23
+bash -c "source $TOP/functions; X=`true`; die_if_not_set $LINENO X 'OK'" > /dev/null 2>&1
24 24
 if [[ $? = 0 ]]; then
25 25
     echo "die_if_not_set [X='' true] Failed"
26 26
 fi
27 27
 
28
-bash -cx "source $TOP/functions; X=`echo Y && false`; die_if_not_set X 'not OK'"
28
+bash -c "source $TOP/functions; X=`echo Y && false`; die_if_not_set $LINENO X 'not OK'"
29 29
 if [[ $? != 0 ]]; then
30 30
     echo "die_if_not_set [X='Y' false] Failed"
31 31
 else
32 32
     echo 'OK'
33 33
 fi
34 34
 
35
-bash -cx "source $TOP/functions; X=`false`; die_if_not_set X 'OK'"
35
+bash -c "source $TOP/functions; X=`false`; die_if_not_set $LINENO X 'OK'" > /dev/null 2>&1
36 36
 if [[ $? = 0 ]]; then
37 37
     echo "die_if_not_set [X='' false] Failed"
38 38
 fi