summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/12-09-2011/truetable.py
diff options
context:
space:
mode:
authortt412011-08-30 19:56:33 +0200
committertt412011-08-30 19:56:33 +0200
commitc7adf3e7b14e382ca92436fd59ad25b115c6f867 (patch)
treec585cdffc539bb34629654c3f215b248c0485045 /For Weekly Test/12-09-2011/truetable.py
parentfix problem on sip true table (diff)
downloadgsm-selftest-c7adf3e7b14e382ca92436fd59ad25b115c6f867.tar.gz
gsm-selftest-c7adf3e7b14e382ca92436fd59ad25b115c6f867.tar.xz
gsm-selftest-c7adf3e7b14e382ca92436fd59ad25b115c6f867.zip
fix another bug on true table for checking sip
Diffstat (limited to 'For Weekly Test/12-09-2011/truetable.py')
-rw-r--r--For Weekly Test/12-09-2011/truetable.py230
1 files changed, 104 insertions, 126 deletions
diff --git a/For Weekly Test/12-09-2011/truetable.py b/For Weekly Test/12-09-2011/truetable.py
index 4f784e8..f30f630 100644
--- a/For Weekly Test/12-09-2011/truetable.py
+++ b/For Weekly Test/12-09-2011/truetable.py
@@ -1,33 +1,31 @@
-def initTrueTable(caller):
- resultsList = [['sip', 'GSMExt.Eplus', '200'], ['sip', 'GSMExt.Tm', '200'], ['sip', 'GSMExt.O2', '200'], ['sip', 'GSMExt.Voda', '200'], ['sip', 'landline', '200'], ['sip', 'unisip', '200'], ['unisip', 'sip', '486']]
-
+def initTrueTable():
+ resultsList = [['sip', 'GSMExt.Eplus', '486'], ['unisip', 'GSMExt.Tm', '486'], ['sip', 'GSMExt.O2', '486'], ['landline', 'GSMExt.Voda', '486'], ['sip', 'landline', '486'], ['sip', 'unisip', '200'], ['unisip', 'sip', '486']]
+ #resultsList = [['GSMExt.Eplus', 'sip', '486'], ['unisip', 'sip', '486'], ['landline', 'sip', '486'], ['unisip', 'sip', '486']]
+
for x in resultsList:
destination = x[1]
result = x[2]
-
- if caller == x[0]:
- if destination == 'GSMRZ1':
+ if destination == 'GSMRZ1':
if result =='486':
for y in resultsList:
destination = y[1]
result = y[2]
- if caller == y[0]:
- if destination == 'GSMRZ2':
+
+ if destination == 'GSMRZ2':
if result == '200':
for z in resultsList:
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMRZ3':
+
+ if destination == 'GSMRZ3':
- if result == '200':
+ if result == '200':
print "BTS RZ 1 Broken"
elif result == '486':
print "BTS RZ 1 & 3 indicate having Problem"
@@ -41,8 +39,7 @@ def initTrueTable(caller):
destination = z[1]
result = z[2]
- if caller == z[0]:
- if destination == 'GSMRZ3':
+ if destination == 'GSMRZ3':
if result == '200':
print "BTS RZ 1 & 2 indicate having Problem"
@@ -60,8 +57,7 @@ def initTrueTable(caller):
destination = y[1]
result = y[2]
- if caller == y[0]:
- if destination == 'GSMRZ2':
+ if destination == 'GSMRZ2':
if result == '200':
for z in resultsList:
@@ -69,8 +65,7 @@ def initTrueTable(caller):
destination = z[1]
result = z[2]
- if caller == z[0]:
- if destination == 'GSMRZ3':
+ if destination == 'GSMRZ3':
if result != '200':
print "BTS RZ 3 Broken"
@@ -82,9 +77,8 @@ def initTrueTable(caller):
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMRZ3':
+
+ if destination == 'GSMRZ3':
if result == '200':
print "BTS RZ 2 Broken"
@@ -98,53 +92,50 @@ def initTrueTable(caller):
else:
print "incomplete test, Handler having error, please do one more test"
- elif destination == 'GSMExt.O2':
+ elif destination == 'GSMExt.O2':
if result == '486':
for y in resultsList:
destination = y[1]
result = y[2]
-
- if caller == y[0]:
- if destination == 'GSMExt.Voda':
+
+ if destination == 'GSMExt.Voda':
if result == '200':
for z in resultsList:
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMExt.Eplus':
+
+ if destination == 'GSMExt.Eplus':
if result == '486':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "O2 & E-Plus indicate having Problem"
- elif result == '486':
- print "T-Mobile, E-plus and O2 cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "O2 & E-Plus indicate having Problem"
+ elif result == '486':
+ print "T-Mobile, E-plus and O2 cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
elif result == '200':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "O2 cards indicate having Problem"
- elif result == '486':
- print "T-Mobile and O2 cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "O2 cards indicate having Problem"
+ elif result == '486':
+ print "T-Mobile and O2 cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
else:
@@ -154,36 +145,33 @@ def initTrueTable(caller):
for z in resultsList:
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMExt.Eplus':
+
+ if destination == 'GSMExt.Eplus':
if result == '200':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "O2 and Vodaphone cards indicate having problem"
- elif result == '486':
- print "T-Mobile, Vodaphone and O2 cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "O2 and Vodaphone cards indicate having problem"
+ elif result == '486':
+ print "T-Mobile, Vodaphone and O2 cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
elif result == '486':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "O2, E-Plus and Vodaphone cards indicate having problem"
- elif result == '486':
- print "GSM External Modem broken"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "O2, E-Plus and Vodaphone cards indicate having problem"
+ elif result == '486':
+ print "GSM External Modem broken"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
else:
print "incomplete test, Handler having error, please do one more test"
else:
@@ -194,45 +182,41 @@ def initTrueTable(caller):
for y in resultsList:
destination = y[1]
result = y[2]
-
- if caller == y[0]:
- if destination == 'GSMExt.Voda':
+
+ if destination == 'GSMExt.Voda':
if result == '200':
for z in resultsList:
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMExt.Eplus':
+
+ if destination == 'GSMExt.Eplus':
if result == '200':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "GSM external modem is working"
- elif result == '486':
- print "T-Mobile card indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "GSM external modem is working"
+ elif result == '486':
+ print "T-Mobile card indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
elif result == '486':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "E-Plus card indicate broken"
- elif result == '486':
- print "T-Mobile and E-plus cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "E-Plus card indicate broken"
+ elif result == '486':
+ print "T-Mobile and E-plus cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
else:
print "incomplete test, Handler having error, please do one more test"
@@ -241,37 +225,34 @@ def initTrueTable(caller):
destination = z[1]
result = z[2]
-
- if caller == z[0]:
- if destination == 'GSMExt.Eplus':
+
+ if destination == 'GSMExt.Eplus':
if result == '200':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "Vodaphone indicate broken"
- elif result == '486':
- print "T-Mobile and Vodaphone cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "Vodaphone indicate broken"
+ elif result == '486':
+ print "T-Mobile and Vodaphone cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
elif result == '486':
for A in resultsList:
destination = A[1]
result = A[2]
- if caller == A[0]:
- if destination == 'GSMExt.Tm':
- if result == '200':
- print "Vodaphone and E-plus cards indicate broken"
- elif result == '486':
- print "T-Mobile, E-plus and Vodaphone cards indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if destination == 'GSMExt.Tm':
+ if result == '200':
+ print "Vodaphone and E-plus cards indicate broken"
+ elif result == '486':
+ print "T-Mobile, E-plus and Vodaphone cards indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
else:
print "incomplete test, Handler having error, please do one more test"
else:
@@ -279,41 +260,38 @@ def initTrueTable(caller):
else:
print "incomplete test, Handler having error, please do one more test"
- elif destination == 'sip':
+ elif destination == 'sip':
if result =='486':
- i=1
+ i = 4
+ j = False
for y in resultsList:
call = y[0]
+ destination = y[1]
result = y[2]
if call == 'sip':
if result == '200':
- i = i-1
+ i = i-4
+ j = True
if result == '486':
i = i+1
- if i > 1:
- print "bad thing happen"
- else:
- print 'Asterisk server working good'
-
- elif result =='200':
- i = 0
- for y in resultsList:
- call = y[0]
- result = y[2]
- if call == 'sip':
+
+ if destination == 'sip':
if result == '200':
- i = i-1
+ i = i-4
+ j = True
if result == '486':
i = i+1
- if i > 1:
- print "bad thing happen"
- else:
- print 'Asterisk server working good'
+
+ elif result =='200':
+ i = -4
+ j = True
+ if i > 1 and j != True:
+ print "bad thing happen"
+ else:
+ print 'Asterisk server working good'
-callerList = [['sip'],['unisip']]
-for caller in callerList:
- initTrueTable(caller[0])
+initTrueTable()