\r
doTest :: (TestState s i o) (IUTstep .t i o) .t (.t->.t) -> (.t,TestState s i o)\r
| gEq{|*|} s & gEq{|*|} o & genShow{|*|} s & genShow{|*|} i & genShow{|*|} o\r
-doTest ts=:{input,curState,spec,incons} step t reset\r
+doTest ts=:{input,curState,spec,incons,stop} step t reset\r
| isEmpty ts.curState\r
= (t, errorFound ts)\r
- | ts.nStep >= ts.maxLen || ts.nRej >= ts.maxLen\r
+ | ts.nStep >= ts.maxLen || ts.nRej >= ts.maxLen || stop curState\r
= doTest (resetState ts) step (reset t) reset\r
| ts.nPath >= ts.maxPath\r
| ts.nRej == 0 && ts.nTrun == 0\r
data = conn.recv(int(data))
print "INPUT: "+data
- if data == 'SYN':
+ if data == 'SUT-RESET':
+ print 'resetting the SUT...'
+ sender = Sender(serverIP="127.0.0.1", networkInterface="lo", isLocal=True, serverPort=serverPort, waitTime=1, isVerbose=0)
+ data = ''
+ continue
+ elif data == 'SYN':
seqnr = 100
print 'S: {}'.format(seqnr)
response = sender.sendInput('S', seqnr, seqnr)
elif data == 'ACK':
- seqnr += 1
- print 'A: {}'.format(seqnr)
- response = sender.sendInput('A', seqnr, sender.lastSeqReceived + 1)
+ response = 'Timeout'
+ if sender.lastSeqReceived != None:
+ seqnr += 1
+ print 'A: {}'.format(seqnr)
+ response = sender.sendInput('A', seqnr, sender.lastSeqReceived + 1)
elif data == 'DATA':
- seqnr += 1
- print 'DAT: {} sending: a'.format(seqnr)
- response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, 'a')
+ response = 'Timeout'
+ if sender.lastSeqReceived != None:
+ seqnr += 1
+ print 'DAT: {} sending: a'.format(seqnr)
+ response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, 'a')
elif data == 'RST':
- seqnr += 1
- print 'RP: {}'.format(seqnr)
- response = sender.sendInput("RP", seqnr, 0)
- sender.sendReset()
+ response = 'Timeout'
+ if sender.lastSeqReceived != None:
+ seqnr += 1
+ print 'RP: {}'.format(seqnr)
+ response = sender.sendInput("RP", seqnr, 0)
+ sender.sendReset()
elif data == 'FIN':
- seqnr += 1
- print 'F: {}'.format(seqnr)
- response = sender.sendInput("FA", seqnr, sender.lastSeqReceived + 1)
+ response = 'Timeout'
+ if sender.lastSeqReceived != None:
+ seqnr += 1
+ print 'F: {}'.format(seqnr)
+ response = sender.sendInput("FA", seqnr, sender.lastSeqReceived + 1)
else:
print 'INVALID INPUT!'
break
data = 'TO'
elif response[0] == 'A':
data = 'ACK'
+ elif response[0] == 'PA':
+ data = 'DATA'
elif response[0] == 'R':
data = 'RST'
elif response[0] == 'SA':