summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaranjeiro2008-03-26 13:30:34 +0000
committerlaranjeiro2008-03-26 13:30:34 +0000
commit1663ebbf61ca50acdcc434d8f4cc34de734bd34c (patch)
tree3000048bf908ae0a24a101307d9e49cc050c078f
parent7099475831b676ac39fbc2205fd4bd25a3b7866a (diff)
Update the maximus test to raise an Error when data are not the expcted
ones. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1635 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--test_general/integration/ipmbox-hle-cl-sar-pbproc/Makefile2
-rw-r--r--test_general/integration/ipmbox-hle-cl-sar-pbproc/src/Maximus.py92
-rw-r--r--test_general/integration/ipmbox-hle-cl-sar-pbproc/src/ipmbox-hle-cl-sar-pbproc.c4
3 files changed, 51 insertions, 47 deletions
diff --git a/test_general/integration/ipmbox-hle-cl-sar-pbproc/Makefile b/test_general/integration/ipmbox-hle-cl-sar-pbproc/Makefile
index b6bad01e7c..6ddc5c49bb 100644
--- a/test_general/integration/ipmbox-hle-cl-sar-pbproc/Makefile
+++ b/test_general/integration/ipmbox-hle-cl-sar-pbproc/Makefile
@@ -14,6 +14,6 @@ ipmbox-hle-cl-sar-pbproc_MODULES = mac cl hle hal lib host cp/beacon\
test_general/station/overide/cp/secu \
test_general/station/overide/cp/cco
-cp_beacon_MODULE_SOURCES = beacons.c bentry.c
+cp_beacon_MODULE_SOURCES = beacons.c bentry.c
include $(BASE)/common/make/top.mk
diff --git a/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/Maximus.py b/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/Maximus.py
index 6c2c2503f4..f807be0120 100644
--- a/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/Maximus.py
+++ b/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/Maximus.py
@@ -9,7 +9,7 @@ from maximus import *
from struct import *
def my_eth_filter(eth):
- if eth.get_type() is not 'PHY_TYPE_MPDU_PAYLOAD':
+ if eth.get_type() is 'ETHERNET_TYPE_DATA':
# The received object is an MSDU
return True
else:
@@ -18,13 +18,16 @@ def my_eth_filter(eth):
maximus = Maximus()
maximus.init (sys.argv + ['-e', './obj/ipmbox-hle-cl-sar-pbproc.elf'])
+realloc_buffer ( True )
+trace_print = False
+
# TEI of station 1 will be 1
station1 = maximus.create_sta()
#station1.debug()
# TEI of station 2 will be 2
station2 = maximus.create_sta()
-station2.debug()
+#station2.debug()
sta1_mac = 0x23456789abcd
sta1_mac_str = pack ('>Q', sta1_mac)[2:8]
@@ -109,8 +112,6 @@ alloc_data_buffer (maximus, station2)
alloc_data_buffer (maximus, station2)
#create three Ethernet Packets
-
-
# read the ethernet full packet
packet_file = open ('../packet_max','r')
packet = packet_file.read()
@@ -139,7 +140,7 @@ frame1.src = '23:45:67:89:ab:cd'
frame1.dst = '12:34:56:78:9a:bc'
frame1.vlantag = 0x81004D4E
frame1.type = 0x4F50
-frame1.payload = pack2;
+frame1.payload = pack2
frame1.send (maximus, station1)
#third frame
@@ -152,56 +153,57 @@ frame2.payload = pack3;
frame2.send (maximus, station1)
#Catch the ethernet packets
-#rsp = recv(maximus, count=3, filter=my_eth_filter)
+rsp = recv(maximus, count=3, filter=my_eth_filter)
-#if (rsp[0].dst != frame0.dst) and (rsp[0].src != frame0.src) and (rsp[0].vlantag != frame0.vlantag) and (rsp[0].type != frame0.type):
-# print "Frame0 dst dont correspond with the dst mac address of the frame"
-#else:
-# if frame0.payload != rsp[0].payload:
-# print "Error the frame 0 payload is deferent from the received one"
+for i in range (0,3):
+ if rsp[i].src <> '23:45:67:89:ab:cd':
+ raise Error ("Mac address src in Ethernet packet", i, "is wrong")
+ elif rsp[i].dst <> '12:34:56:78:9a:bc':
+ raise Error ("Mac address dst in Ethernet packet", i, "is wrong")
+ elif rsp[i].vlantag <> 0x81004D4E:
+ print "Vlantag expected : 0x81004D4E and got : ", rsp[i].vlantag
+ raise Error ("Wrong vlantag")
print "Ending the test\n"
-maximus.wait (10000000)
-while not station1.is_idle() and not station2.is_idle():
- maximus.wait (10000)
+if trace_print == True:
+ #print the traces of the HLE
+ print "\n\n ************** Station 1 Traces *******************\n"
+ fc1 = maximus.create_fcall ("fc_hle_print_trace")
+ fc1.set_sta (station1)
+ fc1.send()
-#print the traces of the HLE
-print "\n\n ************** Station 1 Traces *******************\n"
-fc1 = maximus.create_fcall ("fc_hle_print_trace")
-fc1.set_sta (station1)
-fc1.send()
+ print ""
+ fc1 = maximus.create_fcall ("fc_cl_print_trace")
+ fc1.set_sta (station1)
+ fc1.send()
-print ""
-fc1 = maximus.create_fcall ("fc_cl_print_trace")
-fc1.set_sta (station1)
-fc1.send()
+ print ""
+ fc1 = maximus.create_fcall ("fc_sar_print_trace")
+ fc1.set_sta (station1)
+ fc1.send()
-print ""
-fc1 = maximus.create_fcall ("fc_sar_print_trace")
-fc1.set_sta (station1)
-fc1.send()
+ print "\n\n ************ Station 1 Traces END ******************\n"
-print "\n\n ************ Station 1 Traces END ******************\n"
+ #print the traces of the HLE
+ print "\n\n ************** Station 2 Traces *******************\n"
+ fc1 = maximus.create_fcall ("fc_hle_print_trace")
+ fc1.set_sta (station2)
+ fc1.send()
-station1.remove()
-
-#print the traces of the HLE
-print "\n\n ************** Station 2 Traces *******************\n"
-fc1 = maximus.create_fcall ("fc_hle_print_trace")
-fc1.set_sta (station2)
-fc1.send()
-
-print ""
-fc1 = maximus.create_fcall ("fc_cl_print_trace")
-fc1.set_sta (station2)
-fc1.send()
+ print ""
+ fc1 = maximus.create_fcall ("fc_cl_print_trace")
+ fc1.set_sta (station2)
+ fc1.send()
-print ""
-fc1 = maximus.create_fcall ("fc_sar_print_trace")
-fc1.set_sta (station2)
-fc1.send()
+ print ""
+ fc1 = maximus.create_fcall ("fc_sar_print_trace")
+ fc1.set_sta (station2)
+ fc1.send()
-print "\n\n ************ Station 2 Traces END ******************\n"
+ print "\n\n ************ Station 2 Traces END ******************\n"
+station1.remove()
station2.remove()
+
+print "SUCCEED"
diff --git a/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/ipmbox-hle-cl-sar-pbproc.c b/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/ipmbox-hle-cl-sar-pbproc.c
index d13adc76b9..ddcb8644a4 100644
--- a/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/ipmbox-hle-cl-sar-pbproc.c
+++ b/test_general/integration/ipmbox-hle-cl-sar-pbproc/src/ipmbox-hle-cl-sar-pbproc.c
@@ -86,7 +86,8 @@ void maximus_cp_mme_get (void *user, u8 *buffer)
* \return boolean to indicate if a block had been returned or not.
*/
bool ce_measurements (void *user, pbproc_rx_params_t *rx_params, uint pb_nb,
- blk_t **first, blk_t **last, pb_t *chandata, uint nb_chandata)
+ blk_t **first, blk_t **last, pb_t *chandata, uint nb_chandata, uint
+ *blk_offset)
{
ce_rx_params_node_t *ce_node;
@@ -100,6 +101,7 @@ bool ce_measurements (void *user, pbproc_rx_params_t *rx_params, uint pb_nb,
list_init_node (&ce_node->node);
list_push (&ce_rx_params_list, &ce_node->node);
ce_node->rx_params = rx_params;
+ *blk_offset = 0;
if (chandata)
{