summaryrefslogblamecommitdiffstats
path: root/For Weekly Test/12-09-2011/truetable.py
blob: f30f63031190cd84e17a07974a6f0cdd14e5134d (plain) (tree)
1
2
3
4
5
6
7
8
9



                                                                                                                                                                                                                                   



                          
            
                                    





                                          

                                                   





                                                          

                                                                   
                                            
                                                                   












                                                                                                                          
                                                                   
















                                                                                                                          
                                                   






                                                          
                                                                   










                                                                                  

                                                                   












                                                                                                                          
                                        





                                          

                                                        





                                                          

                                                                         





                                                                          







                                                                                                                                              





                                                                                                                         






                                                                                                                                              








                                                                                                                          

                                                                         





                                                                                                                       






                                                                                                                                              




                                                                                                                         






                                                                                                                                              









                                                                                                                          

                                                        




                                                                                                 

                                                                         





                                                                                                                       






                                                                                                                                              





                                                                                                                         






                                                                                                                                              







                                                                                                                          

                                                                         





                                                                                                                       






                                                                                                                                              





                                                                                                                         






                                                                                                                                              






                                                                                                                          
                                   
                                  

                             
                                         
                                   
                                          


                                                   

                                                

                                                   

                                                
                                                   

                                                

                                                   



                                    
 



                                            
 
               



 
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 destination == 'GSMRZ1': 
                if result =='486':
                
                    for y in resultsList:
                        destination = y[1]
                        result = y[2]
                    	
         
                        if destination == 'GSMRZ2':
                                if result == '200':
                                
                                    for z in resultsList:
                                    
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMRZ3':
                                            
                                        	if result == '200':
                                                    print "BTS RZ 1 Broken"
                                                elif result == '486':
                                                    print "BTS RZ 1 & 3 indicate having Problem"
                                                else:
                                                    print "incomplete test, Handler having error, please do one more test"
                                
                                elif destination == '486':
                                
                                    for z in resultsList:
                                    
                                        destination = z[1]
                                        result = z[2]
                                    
                                        if destination == 'GSMRZ3':
                                            
                                                if result == '200':
                                                    print "BTS RZ 1 & 2 indicate having Problem"
                                                elif result == '486':
                                                    print "OpenBSc Down"
                                                else:
                                                    print "incomplete test, Handler having error, please do one more test"
                                else:
                                    print "incomplete test, Handler having error, please do one more test"
            
                elif result =='200':
                
                    for y in resultsList:
                    
                        destination = y[1]
                        result = y[2]
                    
                        if destination == 'GSMRZ2':
                                if result == '200':
                                
                                    for z in resultsList:
                                    
                                        destination = z[1]
                                        result = z[2]
                                    
                                        if destination == 'GSMRZ3':
                                            
                                                if result != '200':
                                                    print "BTS RZ 3 Broken"
                                                else:
                                                    print "All GSM RZ are working"
                                elif result == '486':
                                
                                    for z in resultsList:
                                    
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMRZ3':
                                            
                                                if result == '200':
                                                    print "BTS RZ 2 Broken"
                                                elif result == '486':
                                                    print "BTS RZ 2 & 3 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:
                    print "incomplete test, Handler having error, please do one more test"
                                                    
        elif destination == 'GSMExt.O2':

                if result == '486':
                    for y in resultsList:
                        
                        destination = y[1]
                        result = y[2]

                        if destination == 'GSMExt.Voda':
                                if result == '200':
                                    
                                    for z in resultsList:
                                        
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMExt.Eplus':
                                                
                                                if result == '486':
						    for A in resultsList:
							destination = A[1]
                                        		result = A[2]


                                      			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 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:
						    print "incomplete test, Handler having error, please do one more test"
                                
                                elif result == '486':
                                    for z in resultsList:                                        
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMExt.Eplus':
                                                
                                                if result == '200':                                                    
						    for A in resultsList:
							destination = A[1]
                                        		result = A[2]

                                       			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 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:
					print "incomplete test, Handler having error, please do one more test"

                elif result == '200':

                    for y in resultsList:                        
                        destination = y[1]
                        result = y[2]

                        if destination == 'GSMExt.Voda':
                                if result == '200':
                                    
                                    for z in resultsList:                                        
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMExt.Eplus':
                                                
                                                if result == '200':                                                    
						    for A in resultsList:
							destination = A[1]
                                        		result = A[2]

                                       			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 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"

                                elif result == '486':
                                    for z in resultsList:
                                        
                                        destination = z[1]
                                        result = z[2]

                                        if destination == 'GSMExt.Eplus':
                                                
                                                if result == '200':                                                    
						    for A in resultsList:
							destination = A[1]
                                        		result = A[2]

                                       			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 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:
                                    print "incomplete test, Handler having error, please do one more test"
                else:
                    print "incomplete test, Handler having error, please do one more test"

        elif destination == 'sip': 
                if result =='486':
		    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-4
					j = True
				if result == '486':
					i = i+1

			if destination == 'sip':
				if result == '200':
					i = i-4
					j = True
				if result == '486':
					i = i+1
            
                elif result =='200':
                    	i = -4
			j = True

    if i > 1 and j != True:
	print "bad thing happen"
    else:
	print 'Asterisk server working good'

initTrueTable()