source: trunk/athena/bin/getcluster/tests.sh @ 12350

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
5temp=/tmp/test.out.$$
6
7export AUTOUPDATE NEW_TESTING_RELEASE NEW_PRODUCTION_RELEASE UPDATE_TIME
8export VAR VAR1 VAR2 VAR3 VAR4 VAR5
9UPDATE_TIME=0
10
11# Test version resolution for AUTOUPDATE false.
12AUTOUPDATE=false
13VAR=
14NEW_TESTING_RELEASE=
15NEW_PRODUCTION_RELEASE=
16./getcluster -b -d ignored 7.7P << EOM > $temp
17var value3 7.8
18var value1 7.6
19var value2 7.7
20var value4 8.0
21EOM
22. $temp
23if [ "$VAR" != value2 -o "$NEW_PRODUCTION_RELEASE" != 8.0 ]; then
24        echo "Test 1 failed."
25        rm -f $temp
26        exit 1
27fi
28echo "Test 1 passed."
29
30# Test version resolution for AUTOUPDATE true, no testing versions
31AUTOUPDATE=true
32VAR=
33NEW_TESTING_RELEASE=
34NEW_PRODUCTION_RELEASE=
35./getcluster -b -d ignored 7.7P << EOM > $temp
36var value4 8.0
37var value3 7.8
38var value1 7.6
39var value2 7.7
40EOM
41. $temp
42if [ "$VAR" != value4 ]; then
43        echo "Test 2 failed."
44        rm -f $temp
45        exit 1
46fi
47echo "Test 2 passed."
48
49# Test version resolution for AUTOUPDATE true, testing versions
50AUTOUPDATE=true
51VAR=
52NEW_TESTING_RELEASE=
53NEW_PRODUCTION_RELEASE=
54./getcluster -b -d ignored 7.7P << EOM > $temp
55var value4 8.0 t
56var value3 7.8
57var value1 7.6
58var value2 7.7
59EOM
60. $temp
61if [ "$VAR" != value3 -o "$NEW_TESTING_RELEASE" != 8.0 ]; then
62        echo "Test 3 failed."
63        rm -f $temp
64        exit 1
65fi
66echo "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.
72AUTOUPDATE=true
73VAR1=
74VAR2=
75VAR3=
76VAR4=
77VAR5=
78NEW_TESTING_RELEASE=
79NEW_PRODUCTION_RELEASE=
80./getcluster -b -d ignored 7.7P << EOM > $temp
81var3 var3value2 7.7 t
82var1 var1value1 8.0 t
83var3 var3value4 8.0 t
84var2 var2value1
85var3 var3value3 7.6
86var4 var4value2 7.7
87var2 var2value3 7.8 t
88var5 var5value1
89var1 var1value2 7.6 t
90var3 var3value1
91var4 var4value1 7.6
92var4 var4value3 8.0
93var2 var2value2 8.0 t
94EOM
95. $temp
96if [ "$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
101fi
102echo "Test 4 passed."
103
104rm -f $temp
Note: See TracBrowser for help on using the repository browser.