summaryrefslogtreecommitdiffstats
path: root/notFinishedCode
diff options
context:
space:
mode:
authorRefik Hadzialic2011-07-25 11:16:56 +0200
committerRefik Hadzialic2011-07-25 11:16:56 +0200
commit740e071f30d09e3b0f2652ab4db826612e0627ef (patch)
tree22d765db12c0dd4a87fae99b9edf4685e99a8dc2 /notFinishedCode
parentTesting code and added another resetState variable to make sure it always goe... (diff)
downloadgsm-selftest-740e071f30d09e3b0f2652ab4db826612e0627ef.tar.gz
gsm-selftest-740e071f30d09e3b0f2652ab4db826612e0627ef.tar.xz
gsm-selftest-740e071f30d09e3b0f2652ab4db826612e0627ef.zip
Changed some lines so it doesn't enter the other state after disconnecting of servers!
Diffstat (limited to 'notFinishedCode')
-rw-r--r--notFinishedCode/clientController.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/notFinishedCode/clientController.py b/notFinishedCode/clientController.py
index 8247eaa..55a867c 100644
--- a/notFinishedCode/clientController.py
+++ b/notFinishedCode/clientController.py
@@ -61,39 +61,39 @@ def receiveMessage(timeout, whoIsWho):
message1 = str(handler2.receiveData(timeout))
message2 = str(handler1.receiveData(timeout))
-
- print 'in receive', message1, message2
-
- if message1 == 'HELLO CONTROLLER' and message2 == 'HELLO CONTROLLER' and lastState == 1:
- outcome = assignJobs(0,455)
-
- elif message1 == 'RECEIVER READY' and message2 == 'CALLER READY' and lastState == 2:
- outcome = startJobs(whoIsWho)
-
- elif message1 == 'CALL OK' and message2 == 'CALL OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'TEST WAS OK'
+ if message1 != '' and message2 !='':
+ print 'in receive', message1, message2
-
- elif message1 == 'CALL NOT OK' and message2 == 'CALL NOT OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'BOTH SIDES FAILED'
-
- elif message1 == 'CALL NOT OK' and message2 == 'CALL OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'ONE SIDE FAILED ', whoIsWho
-
- elif message1 == 'CALL OK' and message2 == 'CALL NOT OK' and lastState == 3:
- outcome = terminateConnection()
- #write to db here
- print 'ONE SIDE FAILED', whoIsWho
-
- else:
- #abort test since they are not initialized
- outcome = other()
+ if message1 == 'HELLO CONTROLLER' and message2 == 'HELLO CONTROLLER' and lastState == 1:
+ outcome = assignJobs(0,455)
+
+ elif message1 == 'RECEIVER READY' and message2 == 'CALLER READY' and lastState == 2:
+ outcome = startJobs(whoIsWho)
+
+ elif message1 == 'CALL OK' and message2 == 'CALL OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'TEST WAS OK'
+
+
+ elif message1 == 'CALL NOT OK' and message2 == 'CALL NOT OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'BOTH SIDES FAILED'
+
+ elif message1 == 'CALL NOT OK' and message2 == 'CALL OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'ONE SIDE FAILED ', whoIsWho
+
+ elif message1 == 'CALL OK' and message2 == 'CALL NOT OK' and lastState == 3:
+ outcome = terminateConnection()
+ #write to db here
+ print 'ONE SIDE FAILED', whoIsWho
+
+ else:
+ #abort test since they are not initialized
+ outcome = other()
def assignJobs(whoIsWho, number):
print 'in assign jobs'