Beispiel #1
0
 def test_2_imsi_imsi_list(self):
     tmp_imsi_list = imsi_list()
     imsi_1 = imsi("1", "3")
     imsi_2 = imsi("2", "3")
     tmp_imsi_list.add_imsi(imsi_1)
     tmp_imsi_list.add_imsi(imsi_2)
     self.assertEqual(2, tmp_imsi_list.get_imsi_list_length())
Beispiel #2
0
    def test_imsi_mon_start(self):
        imsi_1 = imsi('1', '3')
        imsi_2 = imsi('2', '3')
        tmp_imsi_list = imsi_list()
        tmp_imsi_list.add_imsi(imsi_1)
        tmp_imsi_list.add_imsi(imsi_2)
        tmp_imsi_mon_start = imsi_mon_start(tmp_imsi_list)
        self.assertEqual('xb1,2,\
1,10,00,00,00,00,00,00,00,3,\
1,20,00,00,00,00,00,00,00,3,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00',\
tmp_imsi_mon_start.get_imsi_mon_start_str())
Beispiel #3
0
    def test_imsi_list_str(self):
        tmp_imsi_list = imsi_list()
        imsi_1 = imsi("1", "3")
        imsi_2 = imsi("2", "3")
        tmp_imsi_list.add_imsi(imsi_1)
        tmp_imsi_list.add_imsi(imsi_2)
        self.assertEqual(
            "2,\
1,10,00,00,00,00,00,00,00,3,\
1,20,00,00,00,00,00,00,00,3,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00",
            tmp_imsi_list.get_imsi_list_str(),
        )
Beispiel #4
0
 def reset_all_internal_str(self):
     self.imsi_mon_str = '/opt/nokiasiemens/bin/dmxsendcli --unit auto -h *,0102,054f,0,00,04,00,2b24 -b'
     self.imsi_list = imsi_list()
     self.imsi_mon_start = imsi_mon_start(self.imsi_list)
Beispiel #5
0
    def __init__(self):
        self.imsi_mon_str = '/opt/nokiasiemens/bin/dmxsendcli --unit auto -h *,0102,054f,0,00,04,00,2b24 -b'
        self.imsi_list = imsi_list()
        self.imsi_mon_start = imsi_mon_start(self.imsi_list)
        
        self.imsi_val_1_row = 0
        self.imsi_val_2_row = self.imsi_val_1_row + 1
        self.imsi_val_3_row = self.imsi_val_2_row + 1
        self.imsi_val_4_row = self.imsi_val_3_row + 1
        self.imsi_val_5_row = self.imsi_val_4_row + 1
        self.imsi_val_6_row = self.imsi_val_5_row + 1
        self.imsi_val_7_row = self.imsi_val_6_row + 1
        self.imsi_val_8_row = self.imsi_val_7_row + 1
        self.imsi_val_9_row = self.imsi_val_8_row + 1
        self.imsi_val_10_row = self.imsi_val_9_row + 1
        self.imsi_val_11_row = self.imsi_val_10_row + 1
        self.imsi_val_12_row = self.imsi_val_11_row + 1
        self.imsi_val_13_row = self.imsi_val_12_row + 1
        self.imsi_val_14_row = self.imsi_val_13_row + 1
        self.imsi_val_15_row = self.imsi_val_14_row + 1
        self.imsi_val_16_row = self.imsi_val_15_row + 1
        self.dmx_output_row = self.imsi_val_15_row + 3
        
        self.root = Tk()
        self.root.wm_title("IMSI List notify")
        
        # valid percent substitutions (from the Tk entry man page)
        # %d = Type of action (1=insert, 0=delete, -1 for others)
        # %i = index of char string to be inserted/deleted, or -1
        # %P = value of the entry if the edit is allowed
        # %s = value of entry prior to editing
        # %S = the text string being inserted or deleted, if any
        # %v = the type of validation that is currently set
        # %V = the type of validation that triggered the callback
        #      (key, focusin, focusout, forced)
        # %W = the tk name of the widget
        vcmd = (self.root.register(self.OnValidate), 
                '%d', '%i', '%P', '%s', '%S', '%v', '%V', '%W')

        self.label_imsi_val_1 = Label (self.root, text= "imsi_val[0]")
        self.label_imsi_val_1.grid(row=self.imsi_val_1_row)
        self.imsi_val_1_text = StringVar()
#         self.imsi_val_1_text.set('ffff')
        Entry(self.root, textvariable=self.imsi_val_1_text, validate="key", validatecommand=vcmd).grid(row=0, column=1)

        self.label_imsi_val_2 = Label (self.root, text= "imsi_val[1]")
        self.label_imsi_val_2.grid(row=self.imsi_val_2_row)
        self.imsi_val_2_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_2_text, validate="key", validatecommand=vcmd).grid(row=1, column=1)
        
        self.label_imsi_val_3 = Label (self.root, text= "imsi_val[2]")
        self.label_imsi_val_3.grid(row=self.imsi_val_3_row)
        self.imsi_val_3_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_3_text, validate="key", validatecommand=vcmd).grid(row=2, column=1)

        self.label_imsi_val_4 = Label (self.root, text= "imsi_val[3]")
        self.label_imsi_val_4.grid(row=self.imsi_val_4_row)
        self.imsi_val_4_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_4_text, validate="key", validatecommand=vcmd).grid(row=3, column=1)

        self.label_imsi_val_5 = Label (self.root, text= "imsi_val[4]")
        self.label_imsi_val_5.grid(row=self.imsi_val_5_row)
        self.imsi_val_5_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_5_text, validate="key", validatecommand=vcmd).grid(row=4, column=1)

        self.label_imsi_val_6 = Label (self.root, text= "imsi_val[5]")
        self.label_imsi_val_6.grid(row=self.imsi_val_6_row)
        self.imsi_val_6_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_6_text, validate="key", validatecommand=vcmd).grid(row=5, column=1)

        self.label_imsi_val_7 = Label (self.root, text= "imsi_val[6]")
        self.label_imsi_val_7.grid(row=self.imsi_val_7_row)
        self.imsi_val_7_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_7_text, validate="key", validatecommand=vcmd).grid(row=6, column=1)

        self.label_imsi_val_8 = Label (self.root, text= "imsi_val[7]")
        self.label_imsi_val_8.grid(row=self.imsi_val_8_row)
        self.imsi_val_8_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_8_text, validate="key", validatecommand=vcmd).grid(row=7, column=1)


        self.label_imsi_val_9 = Label (self.root, text= "imsi_val[8]")
        self.label_imsi_val_9.grid(row=self.imsi_val_9_row)
        self.imsi_val_9_text = StringVar()
#         self.imsi_val_1_text.set('ffff')
        Entry(self.root, textvariable=self.imsi_val_9_text, validate="key", validatecommand=vcmd).grid(row=8, column=1)

        self.label_imsi_val_10 = Label (self.root, text= "imsi_val[9]")
        self.label_imsi_val_10.grid(row=self.imsi_val_10_row)
        self.imsi_val_10_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_10_text, validate="key", validatecommand=vcmd).grid(row=9, column=1)
        
        self.label_imsi_val_11 = Label (self.root, text= "imsi_val[10]")
        self.label_imsi_val_11.grid(row=self.imsi_val_11_row)
        self.imsi_val_11_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_11_text, validate="key", validatecommand=vcmd).grid(row=10, column=1)

        self.label_imsi_val_12 = Label (self.root, text= "imsi_val[11]")
        self.label_imsi_val_12.grid(row=self.imsi_val_12_row)
        self.imsi_val_12_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_12_text, validate="key", validatecommand=vcmd).grid(row=11, column=1)

        self.label_imsi_val_13 = Label (self.root, text= "imsi_val[12]")
        self.label_imsi_val_13.grid(row=self.imsi_val_13_row)
        self.imsi_val_13_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_13_text, validate="key", validatecommand=vcmd).grid(row=12, column=1)

        self.label_imsi_val_14 = Label (self.root, text= "imsi_val[13]")
        self.label_imsi_val_14.grid(row=self.imsi_val_14_row)
        self.imsi_val_14_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_14_text, validate="key", validatecommand=vcmd).grid(row=13, column=1)

        self.label_imsi_val_15 = Label (self.root, text= "imsi_val[14]")
        self.label_imsi_val_15.grid(row=self.imsi_val_15_row)
        self.imsi_val_15_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_15_text, validate="key", validatecommand=vcmd).grid(row=14, column=1)

        self.label_imsi_val_16 = Label (self.root, text= "imsi_val[15]")
        self.label_imsi_val_16.grid(row=self.imsi_val_16_row)
        self.imsi_val_16_text = StringVar()
        Entry(self.root, textvariable=self.imsi_val_16_text, validate="key", validatecommand=vcmd).grid(row=15, column=1)

        self.buttontext = StringVar()
        self.buttontext.set("Send")
        Button(self.root, textvariable=self.buttontext, command=self.send_handler).grid(row=16)
    
        self.root.mainloop()
Beispiel #6
0
 def test_1_imsi_imsi_list(self):
     tmp_imsi_list = imsi_list()
     imsi_1 = imsi("1", "3")
     tmp_imsi_list.add_imsi(imsi_1)
     self.assertEqual(1, tmp_imsi_list.get_imsi_list_length())