summaryrefslogtreecommitdiff
path: root/cesar/test_general
diff options
context:
space:
mode:
authorCyril Jourdan2013-01-08 14:55:49 +0100
committerCyril Jourdan2013-01-18 11:53:56 +0100
commit24bba9730875f0bf013fc4a5270d22a48ab62f25 (patch)
tree344d45ce8339581e353076da53123497d7ae6b40 /cesar/test_general
parentf40aee8a3fbbbe5df1b1699c0c4ca415b440a977 (diff)
cesar/test_general/station/tonemap: correct vs_get_tonemap test, refs #2366
Parse of interval data was incorrect so the test fails when intervals are activated.
Diffstat (limited to 'cesar/test_general')
-rw-r--r--cesar/test_general/station/tonemap/py/sc02_vs_get_tonemap.py43
1 files changed, 29 insertions, 14 deletions
diff --git a/cesar/test_general/station/tonemap/py/sc02_vs_get_tonemap.py b/cesar/test_general/station/tonemap/py/sc02_vs_get_tonemap.py
index d4e7c2031d..5b0e496e71 100644
--- a/cesar/test_general/station/tonemap/py/sc02_vs_get_tonemap.py
+++ b/cesar/test_general/station/tonemap/py/sc02_vs_get_tonemap.py
@@ -107,14 +107,21 @@ def send_vs_get_tonemap_req (self, tmi, id, dir, dest_sta, remote_sta):
print " Check cnf ok."
#Extract data from entry field
+ data_index = 0
oui = []
for i in range(3):
- oui.append (hex(unpack('B',entry[i])[0]))
- result = unpack ('B', entry[3])[0]
- beacon = unpack ('I', entry[4:8])[0]
- int_id = unpack ('B', entry[8])[0]
- tmi_dflt = unpack ('B', entry[9])[0]
- tmi_length = unpack ('B', entry[10])[0]
+ oui.append (hex(unpack('B',entry[data_index])[0]))
+ data_index += 1
+ result = unpack ('B', entry[data_index])[0]
+ data_index += 1
+ beacon = unpack ('I', entry[data_index:data_index+4])[0]
+ data_index += 4
+ int_id = unpack ('B', entry[data_index])[0]
+ data_index += 1
+ tmi_dflt = unpack ('B', entry[data_index])[0]
+ data_index += 1
+ tmi_length = unpack ('B', entry[data_index])[0]
+ data_index += 1
#Compare received value to expected value
self.failUnless (oui[0] == '0x0')
@@ -125,20 +132,27 @@ def send_vs_get_tonemap_req (self, tmi, id, dir, dest_sta, remote_sta):
#Get TMI's
tmis = []
for i in range(tmi_length):
- tmis.append (unpack ('B', entry[i+11])[0])
+ tmis.append (unpack ('B', entry[data_index])[0])
+ data_index += 1
#Get INT's
int_ets = []
int_tmis = []
- int_length = unpack ('B', entry[tmi_length+11])[0]
+ int_length = unpack ('B', entry[data_index])[0]
+ data_index += 1
for i in range(int_length):
- int_ets.append (unpack ('B', entry[2*i+12+tmi_length])[0])
- int_tmis.append (unpack ('B', entry[2*i+13+tmi_length])[0])
+ int_ets.append (unpack ('H', entry[data_index:data_index+2])[0])
+ data_index += 2
+ int_tmis.append (unpack ('B', entry[data_index])[0])
+ data_index += 1
#Get TMI infos
- tmi = unpack ('B', entry[2 * int_length + tmi_length + 12])[0]
- tm_fec = unpack ('B', entry[2 * int_length + tmi_length + 13])[0]
- tm_gi = unpack ('B', entry[2 * int_length + tmi_length + 14])[0]
+ tmi = unpack ('B', entry[data_index])[0]
+ data_index += 1
+ tm_fec = unpack ('B', entry[data_index])[0]
+ data_index += 1
+ tm_gi = unpack ('B', entry[data_index])[0]
+ data_index += 1
if options.verbose:
print "|result=%d|int_id=%d|tmi_dflt=%d|%d:" % (result, int_id, tmi_dflt, tmi_length),
print tmis,
@@ -149,7 +163,8 @@ def send_vs_get_tonemap_req (self, tmi, id, dir, dest_sta, remote_sta):
#Modulation list
mods = []
for i in range(768):
- mods.append (unpack ('B', entry[i + 2*int_length + tmi_length + 15])[0])
+ mods.append (unpack ('B', entry[data_index])[0])
+ data_index += 1
if options.verbose:
print "0x%02x " % (mods[i]),