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

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