Revision 12350,
2.2 KB
checked in by ghudson, 26 years ago
(diff) |
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # Test getcluster's ability to do proper version resolution. |
---|
3 | # $Id: tests.sh,v 1.4 1999-01-22 23:10:27 ghudson Exp $ |
---|
4 | |
---|
5 | temp=/tmp/test.out.$$ |
---|
6 | |
---|
7 | export AUTOUPDATE NEW_TESTING_RELEASE NEW_PRODUCTION_RELEASE UPDATE_TIME |
---|
8 | export VAR VAR1 VAR2 VAR3 VAR4 VAR5 |
---|
9 | UPDATE_TIME=0 |
---|
10 | |
---|
11 | # Test version resolution for AUTOUPDATE false. |
---|
12 | AUTOUPDATE=false |
---|
13 | VAR= |
---|
14 | NEW_TESTING_RELEASE= |
---|
15 | NEW_PRODUCTION_RELEASE= |
---|
16 | ./getcluster -b -d ignored 7.7P << EOM > $temp |
---|
17 | var value3 7.8 |
---|
18 | var value1 7.6 |
---|
19 | var value2 7.7 |
---|
20 | var value4 8.0 |
---|
21 | EOM |
---|
22 | . $temp |
---|
23 | if [ "$VAR" != value2 -o "$NEW_PRODUCTION_RELEASE" != 8.0 ]; then |
---|
24 | echo "Test 1 failed." |
---|
25 | rm -f $temp |
---|
26 | exit 1 |
---|
27 | fi |
---|
28 | echo "Test 1 passed." |
---|
29 | |
---|
30 | # Test version resolution for AUTOUPDATE true, no testing versions |
---|
31 | AUTOUPDATE=true |
---|
32 | VAR= |
---|
33 | NEW_TESTING_RELEASE= |
---|
34 | NEW_PRODUCTION_RELEASE= |
---|
35 | ./getcluster -b -d ignored 7.7P << EOM > $temp |
---|
36 | var value4 8.0 |
---|
37 | var value3 7.8 |
---|
38 | var value1 7.6 |
---|
39 | var value2 7.7 |
---|
40 | EOM |
---|
41 | . $temp |
---|
42 | if [ "$VAR" != value4 ]; then |
---|
43 | echo "Test 2 failed." |
---|
44 | rm -f $temp |
---|
45 | exit 1 |
---|
46 | fi |
---|
47 | echo "Test 2 passed." |
---|
48 | |
---|
49 | # Test version resolution for AUTOUPDATE true, testing versions |
---|
50 | AUTOUPDATE=true |
---|
51 | VAR= |
---|
52 | NEW_TESTING_RELEASE= |
---|
53 | NEW_PRODUCTION_RELEASE= |
---|
54 | ./getcluster -b -d ignored 7.7P << EOM > $temp |
---|
55 | var value4 8.0 t |
---|
56 | var value3 7.8 |
---|
57 | var value1 7.6 |
---|
58 | var value2 7.7 |
---|
59 | EOM |
---|
60 | . $temp |
---|
61 | if [ "$VAR" != value3 -o "$NEW_TESTING_RELEASE" != 8.0 ]; then |
---|
62 | echo "Test 3 failed." |
---|
63 | rm -f $temp |
---|
64 | exit 1 |
---|
65 | fi |
---|
66 | echo "Test 3 passed." |
---|
67 | |
---|
68 | # Test multiple variables and defaults. Variable 1 should get no value, |
---|
69 | # variable 2 should get the default value, variables 3 and 4 should get |
---|
70 | # a value determined by the version, and variable 5 should get the default |
---|
71 | # value. |
---|
72 | AUTOUPDATE=true |
---|
73 | VAR1= |
---|
74 | VAR2= |
---|
75 | VAR3= |
---|
76 | VAR4= |
---|
77 | VAR5= |
---|
78 | NEW_TESTING_RELEASE= |
---|
79 | NEW_PRODUCTION_RELEASE= |
---|
80 | ./getcluster -b -d ignored 7.7P << EOM > $temp |
---|
81 | var3 var3value2 7.7 t |
---|
82 | var1 var1value1 8.0 t |
---|
83 | var3 var3value4 8.0 t |
---|
84 | var2 var2value1 |
---|
85 | var3 var3value3 7.6 |
---|
86 | var4 var4value2 7.7 |
---|
87 | var2 var2value3 7.8 t |
---|
88 | var5 var5value1 |
---|
89 | var1 var1value2 7.6 t |
---|
90 | var3 var3value1 |
---|
91 | var4 var4value1 7.6 |
---|
92 | var4 var4value3 8.0 |
---|
93 | var2 var2value2 8.0 t |
---|
94 | EOM |
---|
95 | . $temp |
---|
96 | if [ "$VAR2" != var2value1 -o "$VAR3" != var3value2 -o "$VAR4" != var4value3 \ |
---|
97 | -o "$VAR5" != var5value1 -o "$NEW_TESTING_RELEASE" != 8.0 ]; then |
---|
98 | echo "Test 4 failed." |
---|
99 | rm -f $temp |
---|
100 | exit 1 |
---|
101 | fi |
---|
102 | echo "Test 4 passed." |
---|
103 | |
---|
104 | rm -f $temp |
---|
Note: See
TracBrowser
for help on using the repository browser.