00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 from rtc_handle10_11 import *
00012 from BasicDataType_idl import *
00013 import time
00014 import commands
00015 import SDOPackage
00016 import os
00017 import sys
00018
00019
00020 g_test_name = "<< component connection test >>"
00021
00022
00023
00024
00025
00026
00027 env = RtmEnv(sys.argv, ["localhost:2809"])
00028 list0 = env.name_space["localhost:2809"].list_obj()
00029 env.name_space['localhost:2809'].rtc_handles.keys()
00030 ns = env.name_space['localhost:2809']
00031
00032 g_compo_send = ns.rtc_handles["AutoTestOut0.rtc"]
00033 g_compo_recv = ns.rtc_handles["AutoTestIn0.rtc"]
00034
00035 ec_send = g_compo_send.rtc_ref.get_owned_contexts()
00036 ec_recv = g_compo_recv.rtc_ref.get_owned_contexts()
00037
00038 g_out_ports = g_compo_send.rtc_ref.get_ports()
00039 g_in_ports = g_compo_recv.rtc_ref.get_ports()
00040
00041
00042
00043
00044
00045 time.sleep(2)
00046
00047
00048
00049 g_interface_type1 = "corba_cdr"
00050 g_dataflow_type = "push"
00051 g_subscription_type = "flush"
00052 g_push_policy = "NEW"
00053 g_push_rate = "2000"
00054 g_skip_count = "4"
00055
00056
00057
00058 g_port1 = 0
00059 g_port2 = 1
00060 g_port3 = 2
00061
00062
00063
00064
00065
00066
00067
00068
00069 g_name1 = "out"
00070 g_connector_id1 = "001"
00071 g_data_type1 = "TimedFloat"
00072
00073 g_conprof1 = RTC.ConnectorProfile(g_name1, g_connector_id1, [g_out_ports[g_port1], g_in_ports[g_port1]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type1)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(g_subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(g_push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00074
00075
00076 g_name2 = "seqout"
00077 g_connector_id2 = "002"
00078 g_data_type2 = "TimedFloatSeq"
00079
00080 g_conprof2 = RTC.ConnectorProfile(g_name2, g_connector_id2, [g_out_ports[g_port2], g_in_ports[g_port2]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type2)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(g_subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(g_push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00081
00082
00083 g_name3 = "MyService"
00084 g_connector_id3 = "003"
00085 g_interface_type3 = "MyService"
00086
00087 g_conprof3 = RTC.ConnectorProfile(g_name3, g_connector_id3, [g_out_ports[g_port3], g_in_ports[g_port3]], [SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type3))])
00088
00089
00090
00091 g_diff_send_file = "./original-data"
00092 g_diff_recv_file = "./received-data"
00093 g_check_message = g_diff_recv_file + " file not found."
00094 g_test_result_file = "./ResultTest.log"
00095 g_test_case = "case"
00096 g_test_cnt = "count"
00097 g_test_ok = "OK."
00098 g_test_ng = "NG detected."
00099 g_test_ng_message = " < received-data >"
00100 g_mess_header = "< "
00101 g_mess_footer = " > "
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 def make_connecter_profile(subscription_type, push_policy, connect_direction):
00115 global g_conprof1, g_conprof2, g_conprof3
00116
00117 if connect_direction == 0:
00118
00119 g_conprof1 = RTC.ConnectorProfile(g_name1, g_connector_id1, [g_out_ports[g_port1], g_in_ports[g_port1]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type1)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00120
00121 g_conprof2 = RTC.ConnectorProfile(g_name2, g_connector_id2, [g_out_ports[g_port2], g_in_ports[g_port2]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type2)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00122
00123
00124
00125
00126 else:
00127
00128 g_conprof1 = RTC.ConnectorProfile(g_name1, g_connector_id1, [g_in_ports[g_port1], g_out_ports[g_port1]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type1)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00129
00130 g_conprof2 = RTC.ConnectorProfile(g_name2, g_connector_id2, [g_in_ports[g_port2], g_out_ports[g_port2]], [SDOPackage.NameValue("dataport.data_type",any.to_any(g_data_type2)),SDOPackage.NameValue("dataport.interface_type",any.to_any(g_interface_type1)),SDOPackage.NameValue("dataport.dataflow_type",any.to_any(g_dataflow_type)),SDOPackage.NameValue("dataport.subscription_type",any.to_any(subscription_type)),SDOPackage.NameValue("dataport.publisher.push_policy",any.to_any(push_policy)),SDOPackage.NameValue("dataport.publisher.push_rate",any.to_any(g_push_rate)),SDOPackage.NameValue("dataport.publisher.skip_count",any.to_any(g_skip_count))])
00131
00132
00133
00134
00135 return
00136
00137
00138
00139
00140
00141
00142
00143
00144 def delete_recv_file():
00145
00146 if os.path.isfile(g_diff_recv_file) == True:
00147 os.remove(g_diff_recv_file)
00148 return
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 def diff_file():
00159 bret = True
00160
00161
00162
00163
00164 if os.path.isfile(g_diff_send_file) == False:
00165 print "send_file (%s) not found." % send_file
00166 return False
00167
00168
00169 if os.path.isfile(g_diff_recv_file) == False:
00170 print "recv_file (%s) not found." % recv_file
00171 return False
00172
00173
00174 f_send = open(g_diff_send_file, 'r')
00175 f_recv = open(g_diff_recv_file, 'r')
00176
00177 while(1):
00178 str_send = f_send.readline()
00179 str_recv = f_recv.readline()
00180 if len(str_send) == 0:
00181 break
00182
00183
00184
00185
00186
00187
00188
00189 str_send2 = str_send.rstrip('\n')
00190 str_send2 = str_send2.rstrip('\r')
00191 str_recv2 = str_recv.rstrip('\n')
00192 str_recv2 = str_recv2.rstrip('\r')
00193
00194
00195
00196
00197
00198 if str_send2 != str_recv2:
00199
00200
00201
00202 bret = False
00203 break;
00204
00205 f_recv.close()
00206 f_send.close()
00207 return bret
00208
00209
00210
00211
00212 case_no = 0
00213
00214
00215 loop_count = 3
00216
00217
00218 sleep_recv_act_time = 1
00219
00220
00221 sleep_act_time = 10
00222
00223
00224 sleep_for_time = 2
00225
00226
00227 sleep_connect_time = 2
00228
00229
00230 fout = open(g_test_result_file, 'w')
00231 fout.write(g_test_name + '\n')
00232 fout.close()
00233
00234
00235 time.sleep(1)
00236
00237
00238
00239
00240 case_no = case_no + 1
00241 fout = open(g_test_result_file, 'a')
00242 message = g_mess_header + g_test_case + str(case_no) + " "
00243 message = message + "Connect(out->in, flush) -> Disconnect"
00244 message = message + g_mess_footer
00245 fout.write(message + '\n')
00246 fout.close()
00247 print message
00248
00249 for i in range(loop_count):
00250
00251
00252 make_connecter_profile("flush", "", 0)
00253
00254
00255
00256 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00257
00258
00259 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00260
00261
00262 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00263
00264 time.sleep(sleep_connect_time)
00265
00266
00267 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00268 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00269 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00270
00271
00272 fout = open(g_test_result_file, 'a')
00273 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00274 message = message + g_test_ok
00275 print message
00276 fout.write(message + '\n')
00277 fout.close()
00278
00279 time.sleep(sleep_for_time)
00280
00281
00282
00283
00284 case_no = case_no + 1
00285 fout = open(g_test_result_file, 'a')
00286 message = g_mess_header + g_test_case + str(case_no) + " "
00287 message = message + "Connect(in->out, flush) -> Disconnect"
00288 message = message + g_mess_footer
00289 fout.write(message + '\n')
00290 fout.close()
00291 print message
00292
00293 for i in range(loop_count):
00294
00295
00296 make_connecter_profile("flush", "", 1)
00297
00298
00299
00300 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00301
00302
00303 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00304
00305
00306 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00307
00308 time.sleep(sleep_connect_time)
00309
00310
00311 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00312 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00313 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00314
00315
00316 fout = open(g_test_result_file, 'a')
00317 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00318 message = message + g_test_ok
00319 print message
00320 fout.write(message + '\n')
00321 fout.close()
00322
00323 time.sleep(sleep_for_time)
00324
00325
00326
00327
00328 case_no = case_no + 1
00329 fout = open(g_test_result_file, 'a')
00330 message = g_mess_header + g_test_case + str(case_no) + " "
00331 message = message + "Connecting(out->in, flush), Activate -> send/recv -> Deactivate"
00332 message = message + g_mess_footer
00333 fout.write(message + '\n')
00334 fout.close()
00335 print message
00336
00337
00338 make_connecter_profile("flush", "", 0)
00339
00340
00341
00342 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00343
00344
00345 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00346
00347
00348 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00349
00350 for i in range(loop_count):
00351
00352
00353 delete_recv_file()
00354
00355
00356 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00357 time.sleep(sleep_recv_act_time)
00358 ec_send[0].activate_component(g_compo_send.rtc_ref)
00359
00360 time.sleep(sleep_act_time)
00361
00362
00363 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00364 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00365
00366
00367 if os.path.isfile(g_diff_recv_file) == False:
00368 fout = open(g_test_result_file, 'a')
00369 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00370 message = message + g_check_message
00371 fout.write(message + '\n')
00372 fout.close()
00373 print message
00374 time.sleep(sleep_for_time)
00375 continue
00376
00377
00378 time.sleep(sleep_act_time)
00379 bret = diff_file()
00380
00381
00382 fout = open(g_test_result_file, 'a')
00383 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00384
00385 if bret == True:
00386
00387 message = message + g_test_ok
00388 print message
00389 fout.write(message + '\n')
00390 else:
00391
00392 message = message + g_test_ng
00393 print message
00394 message = message + g_test_ng_message
00395 fout.write(message + '\n')
00396
00397 fin2 = open(g_diff_recv_file, 'r')
00398 while(1):
00399 s2 = fin2.readline()
00400 if len(s2) == 0:
00401 break
00402 fout.write(s2)
00403 fin2.close()
00404 fout.close()
00405
00406 time.sleep(sleep_for_time)
00407
00408
00409 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00410 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00411 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00412
00413
00414
00415
00416 case_no = case_no + 1
00417 fout = open(g_test_result_file, 'a')
00418 message = g_mess_header + g_test_case + str(case_no) + " "
00419 message = message + "Connecting(in->out, flush), Activate -> send/recv -> Deactivate"
00420 message = message + g_mess_footer
00421 fout.write(message + '\n')
00422 fout.close()
00423 print message
00424
00425
00426 make_connecter_profile("flush", "", 1)
00427
00428
00429
00430 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00431
00432
00433 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00434
00435
00436 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00437
00438 for i in range(loop_count):
00439
00440
00441 delete_recv_file()
00442
00443
00444 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00445 time.sleep(sleep_recv_act_time)
00446 ec_send[0].activate_component(g_compo_send.rtc_ref)
00447
00448 time.sleep(sleep_act_time)
00449
00450
00451 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00452 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00453
00454
00455 if os.path.isfile(g_diff_recv_file) == False:
00456 fout = open(g_test_result_file, 'a')
00457 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00458 message = message + g_check_message
00459 fout.write(message + '\n')
00460 fout.close()
00461 print message
00462 time.sleep(sleep_for_time)
00463 continue
00464
00465
00466 time.sleep(sleep_act_time)
00467 bret = diff_file()
00468
00469
00470 fout = open(g_test_result_file, 'a')
00471 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00472
00473 if bret == True:
00474
00475 message = message + g_test_ok
00476 print message
00477 fout.write(message + '\n')
00478 else:
00479
00480 message = message + g_test_ng
00481 print message
00482 message = message + g_test_ng_message
00483 fout.write(message + '\n')
00484
00485 fin2 = open(g_diff_recv_file, 'r')
00486 while(1):
00487 s2 = fin2.readline()
00488 if len(s2) == 0:
00489 break
00490 fout.write(s2)
00491 fin2.close()
00492 fout.close()
00493
00494 time.sleep(sleep_for_time)
00495
00496
00497 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00498 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00499 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00500
00501
00502
00503
00504 case_no = case_no + 1
00505 fout = open(g_test_result_file, 'a')
00506 message = g_mess_header + g_test_case + str(case_no) + " "
00507 message = message + "Not Connect(out->in, flush), Activate -> Deactivate"
00508 message = message + g_mess_footer
00509 fout.write(message + '\n')
00510 fout.close()
00511 print message
00512
00513 for i in range(loop_count):
00514
00515
00516 make_connecter_profile("flush", "", 0)
00517
00518
00519 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00520 time.sleep(sleep_recv_act_time)
00521 ec_send[0].activate_component(g_compo_send.rtc_ref)
00522
00523 time.sleep(sleep_act_time)
00524
00525
00526 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00527 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00528
00529
00530 fout = open(g_test_result_file, 'a')
00531 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00532 message = message + g_test_ok
00533 print message
00534 fout.write(message + '\n')
00535 fout.close()
00536
00537 time.sleep(sleep_for_time)
00538
00539
00540
00541
00542 case_no = case_no + 1
00543 fout = open(g_test_result_file, 'a')
00544 message = g_mess_header + g_test_case + str(case_no) + " "
00545 message = message + "Connect(out->in, flush) -> Activate -> send/recv -> Deactivate -> Disconnect"
00546 message = message + g_mess_footer
00547 fout.write(message + '\n')
00548 fout.close()
00549 print message
00550
00551 for i in range(loop_count):
00552
00553
00554 delete_recv_file()
00555
00556
00557 make_connecter_profile("flush", "", 0)
00558
00559
00560
00561 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00562
00563
00564 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00565
00566
00567 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00568
00569
00570 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00571 time.sleep(sleep_recv_act_time)
00572 ec_send[0].activate_component(g_compo_send.rtc_ref)
00573
00574 time.sleep(sleep_act_time)
00575
00576
00577 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00578 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00579
00580
00581 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00582 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00583 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00584
00585
00586 if os.path.isfile(g_diff_recv_file) == False:
00587 fout = open(g_test_result_file, 'a')
00588 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00589 message = message + g_check_message
00590 fout.write(message + '\n')
00591 fout.close()
00592 print message
00593 time.sleep(sleep_for_time)
00594 continue
00595
00596
00597 time.sleep(sleep_act_time)
00598 bret = diff_file()
00599
00600
00601 fout = open(g_test_result_file, 'a')
00602 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00603
00604 if bret == True:
00605
00606 message = message + g_test_ok
00607 print message
00608 fout.write(message + '\n')
00609 else:
00610
00611 message = message + g_test_ng
00612 print message
00613 message = message + g_test_ng_message
00614 fout.write(message + '\n')
00615
00616 fin2 = open(g_diff_recv_file, 'r')
00617 while(1):
00618 s2 = fin2.readline()
00619 if len(s2) == 0:
00620 break
00621 fout.write(s2)
00622 fin2.close()
00623 fout.close()
00624
00625 time.sleep(sleep_for_time)
00626
00627
00628
00629
00630 case_no = case_no + 1
00631 fout = open(g_test_result_file, 'a')
00632 message = g_mess_header + g_test_case + str(case_no) + " "
00633 message = message + "Connect(in->out, flush) -> Activate -> send/recv -> Deactivate -> Disconnect"
00634 message = message + g_mess_footer
00635 fout.write(message + '\n')
00636 fout.close()
00637 print message
00638
00639 for i in range(loop_count):
00640
00641
00642 delete_recv_file()
00643
00644
00645 make_connecter_profile("flush", "", 1)
00646
00647
00648
00649 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00650
00651
00652 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00653
00654
00655 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00656
00657
00658 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00659 time.sleep(sleep_recv_act_time)
00660 ec_send[0].activate_component(g_compo_send.rtc_ref)
00661
00662 time.sleep(sleep_act_time)
00663
00664
00665 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00666 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00667
00668
00669 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00670 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00671 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00672
00673
00674 if os.path.isfile(g_diff_recv_file) == False:
00675 fout = open(g_test_result_file, 'a')
00676 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00677 message = message + g_check_message
00678 fout.write(message + '\n')
00679 fout.close()
00680 print message
00681 time.sleep(sleep_for_time)
00682 continue
00683
00684
00685 time.sleep(sleep_act_time)
00686 bret = diff_file()
00687
00688
00689 fout = open(g_test_result_file, 'a')
00690 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00691
00692 if bret == True:
00693
00694 message = message + g_test_ok
00695 print message
00696 fout.write(message + '\n')
00697 else:
00698
00699 message = message + g_test_ng
00700 print message
00701 message = message + g_test_ng_message
00702 fout.write(message + '\n')
00703
00704 fin2 = open(g_diff_recv_file, 'r')
00705 while(1):
00706 s2 = fin2.readline()
00707 if len(s2) == 0:
00708 break
00709 fout.write(s2)
00710 fin2.close()
00711 fout.close()
00712
00713 time.sleep(sleep_for_time)
00714
00715
00716
00717
00718 case_no = case_no + 1
00719 fout = open(g_test_result_file, 'a')
00720 message = g_mess_header + g_test_case + str(case_no) + " "
00721 message = message + "Connect(out->in, flush) -> Activate -> send/recv -> Disconnect -> Deactivate"
00722 message = message + g_mess_footer
00723 fout.write(message + '\n')
00724 fout.close()
00725 print message
00726
00727 for i in range(loop_count):
00728
00729
00730 delete_recv_file()
00731
00732
00733 make_connecter_profile("flush", "", 0)
00734
00735
00736
00737 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00738
00739
00740 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00741
00742
00743 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00744
00745
00746 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00747 time.sleep(sleep_recv_act_time)
00748 ec_send[0].activate_component(g_compo_send.rtc_ref)
00749
00750 time.sleep(sleep_act_time)
00751
00752
00753 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00754 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00755 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00756
00757
00758 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00759 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00760
00761
00762 if os.path.isfile(g_diff_recv_file) == False:
00763 fout = open(g_test_result_file, 'a')
00764 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00765 message = message + g_check_message
00766 fout.write(message + '\n')
00767 fout.close()
00768 print message
00769 time.sleep(sleep_for_time)
00770 continue
00771
00772
00773 time.sleep(sleep_act_time)
00774 bret = diff_file()
00775
00776
00777 fout = open(g_test_result_file, 'a')
00778 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00779
00780 if bret == True:
00781
00782 message = message + g_test_ok
00783 print message
00784 fout.write(message + '\n')
00785 else:
00786
00787 message = message + g_test_ng
00788 print message
00789 message = message + g_test_ng_message
00790 fout.write(message + '\n')
00791
00792 fin2 = open(g_diff_recv_file, 'r')
00793 while(1):
00794 s2 = fin2.readline()
00795 if len(s2) == 0:
00796 break
00797 fout.write(s2)
00798 fin2.close()
00799 fout.close()
00800
00801 time.sleep(sleep_for_time)
00802
00803
00804
00805
00806 case_no = case_no + 1
00807 fout = open(g_test_result_file, 'a')
00808 message = g_mess_header + g_test_case + str(case_no) + " "
00809 message = message + "Connect(in->out, flush) -> Activate -> send/recv -> Disconnect -> Deactivate"
00810 message = message + g_mess_footer
00811 fout.write(message + '\n')
00812 fout.close()
00813 print message
00814
00815 for i in range(loop_count):
00816
00817
00818 delete_recv_file()
00819
00820
00821 make_connecter_profile("flush", "", 1)
00822
00823
00824
00825 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00826
00827
00828 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00829
00830
00831 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00832
00833
00834 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00835 time.sleep(sleep_recv_act_time)
00836 ec_send[0].activate_component(g_compo_send.rtc_ref)
00837
00838 time.sleep(sleep_act_time)
00839
00840
00841 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00842 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00843 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00844
00845
00846 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00847 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00848
00849
00850 if os.path.isfile(g_diff_recv_file) == False:
00851 fout = open(g_test_result_file, 'a')
00852 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00853 message = message + g_check_message
00854 fout.write(message + '\n')
00855 fout.close()
00856 print message
00857 time.sleep(sleep_for_time)
00858 continue
00859
00860
00861 time.sleep(sleep_act_time)
00862 bret = diff_file()
00863
00864
00865 fout = open(g_test_result_file, 'a')
00866 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00867
00868 if bret == True:
00869
00870 message = message + g_test_ok
00871 print message
00872 fout.write(message + '\n')
00873 else:
00874
00875 message = message + g_test_ng
00876 print message
00877 message = message + g_test_ng_message
00878 fout.write(message + '\n')
00879
00880 fin2 = open(g_diff_recv_file, 'r')
00881 while(1):
00882 s2 = fin2.readline()
00883 if len(s2) == 0:
00884 break
00885 fout.write(s2)
00886 fin2.close()
00887 fout.close()
00888
00889 time.sleep(sleep_for_time)
00890
00891
00892
00893
00894
00895
00896 case_no = case_no + 1
00897 fout = open(g_test_result_file, 'a')
00898 message = g_mess_header + g_test_case + str(case_no) + " "
00899 message = message + "Activate -> Connect(out->in, flush) -> send/recv -> Deactivate -> Disconnect"
00900 message = message + g_mess_footer
00901 fout.write(message + '\n')
00902 fout.close()
00903 print message
00904
00905 for i in range(loop_count):
00906
00907
00908 delete_recv_file()
00909
00910
00911 make_connecter_profile("flush", "", 0)
00912
00913
00914 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
00915 time.sleep(sleep_recv_act_time)
00916 ec_send[0].activate_component(g_compo_send.rtc_ref)
00917
00918
00919
00920 ret0 = g_out_ports[g_port1].connect(g_conprof1)
00921
00922
00923 ret1 = g_out_ports[g_port2].connect(g_conprof2)
00924
00925
00926 ret2 = g_out_ports[g_port3].connect(g_conprof3)
00927
00928 time.sleep(sleep_act_time)
00929
00930
00931 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
00932 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
00933
00934
00935 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
00936 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
00937 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
00938
00939
00940 if os.path.isfile(g_diff_recv_file) == False:
00941 fout = open(g_test_result_file, 'a')
00942 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00943 message = message + g_check_message
00944 fout.write(message + '\n')
00945 fout.close()
00946 print message
00947 time.sleep(sleep_for_time)
00948 continue
00949
00950
00951 time.sleep(sleep_act_time)
00952 bret = diff_file()
00953
00954
00955 fout = open(g_test_result_file, 'a')
00956 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
00957
00958 if bret == True:
00959
00960 message = message + g_test_ok
00961 print message
00962 fout.write(message + '\n')
00963 else:
00964
00965 message = message + g_test_ng
00966 print message
00967 message = message + g_test_ng_message
00968 fout.write(message + '\n')
00969
00970 fin2 = open(g_diff_recv_file, 'r')
00971 while(1):
00972 s2 = fin2.readline()
00973 if len(s2) == 0:
00974 break
00975 fout.write(s2)
00976 fin2.close()
00977 fout.close()
00978
00979 time.sleep(sleep_for_time)
00980
00981
00982
00983
00984
00985 case_no = case_no + 1
00986 fout = open(g_test_result_file, 'a')
00987 message = g_mess_header + g_test_case + str(case_no) + " "
00988 message = message + "Activate -> Connect(in->out, flush) -> send/recv -> Deactivate -> Disconnect"
00989 message = message + g_mess_footer
00990 fout.write(message + '\n')
00991 fout.close()
00992 print message
00993
00994 for i in range(loop_count):
00995
00996
00997 delete_recv_file()
00998
00999
01000 make_connecter_profile("flush", "", 1)
01001
01002
01003 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01004 time.sleep(sleep_recv_act_time)
01005 ec_send[0].activate_component(g_compo_send.rtc_ref)
01006
01007
01008
01009 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01010
01011
01012 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01013
01014
01015 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01016
01017 time.sleep(sleep_act_time)
01018
01019
01020 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01021 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01022
01023
01024 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01025 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01026 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01027
01028
01029 if os.path.isfile(g_diff_recv_file) == False:
01030 fout = open(g_test_result_file, 'a')
01031 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01032 message = message + g_check_message
01033 fout.write(message + '\n')
01034 fout.close()
01035 print message
01036 time.sleep(sleep_for_time)
01037 continue
01038
01039
01040 time.sleep(sleep_act_time)
01041 bret = diff_file()
01042
01043
01044 fout = open(g_test_result_file, 'a')
01045 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01046
01047 if bret == True:
01048
01049 message = message + g_test_ok
01050 print message
01051 fout.write(message + '\n')
01052 else:
01053
01054 message = message + g_test_ng
01055 print message
01056 message = message + g_test_ng_message
01057 fout.write(message + '\n')
01058
01059 fin2 = open(g_diff_recv_file, 'r')
01060 while(1):
01061 s2 = fin2.readline()
01062 if len(s2) == 0:
01063 break
01064 fout.write(s2)
01065 fin2.close()
01066 fout.close()
01067
01068 time.sleep(sleep_for_time)
01069
01070
01071
01072
01073
01074 case_no = case_no + 1
01075 fout = open(g_test_result_file, 'a')
01076 message = g_mess_header + g_test_case + str(case_no) + " "
01077 message = message + "Activate -> Connect(out->in, flush) -> send/recv -> Disconnect -> Deactivate"
01078 message = message + g_mess_footer
01079 fout.write(message + '\n')
01080 fout.close()
01081 print message
01082
01083 for i in range(loop_count):
01084
01085
01086 delete_recv_file()
01087
01088
01089 make_connecter_profile("flush", "", 0)
01090
01091
01092 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01093 time.sleep(sleep_recv_act_time)
01094 ec_send[0].activate_component(g_compo_send.rtc_ref)
01095
01096
01097
01098 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01099
01100
01101 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01102
01103
01104 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01105
01106 time.sleep(sleep_act_time)
01107
01108
01109 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01110 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01111 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01112
01113
01114 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01115 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01116
01117
01118 if os.path.isfile(g_diff_recv_file) == False:
01119 fout = open(g_test_result_file, 'a')
01120 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01121 message = message + g_check_message
01122 fout.write(message + '\n')
01123 fout.close()
01124 print message
01125 time.sleep(sleep_for_time)
01126 continue
01127
01128
01129 time.sleep(sleep_act_time)
01130 bret = diff_file()
01131
01132
01133 fout = open(g_test_result_file, 'a')
01134 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01135
01136 if bret == True:
01137
01138 message = message + g_test_ok
01139 print message
01140 fout.write(message + '\n')
01141 else:
01142
01143 message = message + g_test_ng
01144 print message
01145 message = message + g_test_ng_message
01146 fout.write(message + '\n')
01147
01148 fin2 = open(g_diff_recv_file, 'r')
01149 while(1):
01150 s2 = fin2.readline()
01151 if len(s2) == 0:
01152 break
01153 fout.write(s2)
01154 fin2.close()
01155 fout.close()
01156
01157 time.sleep(sleep_for_time)
01158
01159
01160
01161
01162
01163 case_no = case_no + 1
01164 fout = open(g_test_result_file, 'a')
01165 message = g_mess_header + g_test_case + str(case_no) + " "
01166 message = message + "Activate -> Connect(in->out, flush) -> send/recv -> Disconnect -> Deactivate"
01167 message = message + g_mess_footer
01168 fout.write(message + '\n')
01169 fout.close()
01170 print message
01171
01172 for i in range(loop_count):
01173
01174
01175 delete_recv_file()
01176
01177
01178 make_connecter_profile("flush", "", 1)
01179
01180
01181 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01182 time.sleep(sleep_recv_act_time)
01183 ec_send[0].activate_component(g_compo_send.rtc_ref)
01184
01185
01186
01187 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01188
01189
01190 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01191
01192
01193 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01194
01195 time.sleep(sleep_act_time)
01196
01197
01198 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01199 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01200 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01201
01202
01203 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01204 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01205
01206
01207 if os.path.isfile(g_diff_recv_file) == False:
01208 fout = open(g_test_result_file, 'a')
01209 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01210 message = message + g_check_message
01211 fout.write(message + '\n')
01212 fout.close()
01213 print message
01214 time.sleep(sleep_for_time)
01215 continue
01216
01217
01218 time.sleep(sleep_act_time)
01219 bret = diff_file()
01220
01221
01222 fout = open(g_test_result_file, 'a')
01223 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01224
01225 if bret == True:
01226
01227 message = message + g_test_ok
01228 print message
01229 fout.write(message + '\n')
01230 else:
01231
01232 message = message + g_test_ng
01233 print message
01234 message = message + g_test_ng_message
01235 fout.write(message + '\n')
01236
01237 fin2 = open(g_diff_recv_file, 'r')
01238 while(1):
01239 s2 = fin2.readline()
01240 if len(s2) == 0:
01241 break
01242 fout.write(s2)
01243 fin2.close()
01244 fout.close()
01245
01246 time.sleep(sleep_for_time)
01247
01248
01249
01250
01251
01252 case_no = case_no + 1
01253 fout = open(g_test_result_file, 'a')
01254 message = g_mess_header + g_test_case + str(case_no) + " "
01255 message = message + "Connect(out->in, new,ALL) -> Disconnect"
01256 message = message + g_mess_footer
01257 fout.write(message + '\n')
01258 fout.close()
01259 print message
01260
01261 for i in range(loop_count):
01262
01263
01264 make_connecter_profile("new", "ALL", 0)
01265
01266
01267
01268 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01269
01270
01271 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01272
01273
01274 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01275
01276 time.sleep(sleep_connect_time)
01277
01278
01279 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01280 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01281 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01282
01283
01284 fout = open(g_test_result_file, 'a')
01285 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01286 message = message + g_test_ok
01287 print message
01288 fout.write(message + '\n')
01289 fout.close()
01290
01291 time.sleep(sleep_for_time)
01292
01293
01294
01295
01296 case_no = case_no + 1
01297 fout = open(g_test_result_file, 'a')
01298 message = g_mess_header + g_test_case + str(case_no) + " "
01299 message = message + "Connect(out->in, new,FIFO) -> Disconnect"
01300 message = message + g_mess_footer
01301 fout.write(message + '\n')
01302 fout.close()
01303 print message
01304
01305 for i in range(loop_count):
01306
01307
01308 make_connecter_profile("new", "FIFO", 0)
01309
01310
01311
01312 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01313
01314
01315 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01316
01317
01318 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01319
01320 time.sleep(sleep_connect_time)
01321
01322
01323 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01324 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01325 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01326
01327
01328 fout = open(g_test_result_file, 'a')
01329 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01330 message = message + g_test_ok
01331 print message
01332 fout.write(message + '\n')
01333 fout.close()
01334
01335 time.sleep(sleep_for_time)
01336
01337
01338
01339
01340 case_no = case_no + 1
01341 fout = open(g_test_result_file, 'a')
01342 message = g_mess_header + g_test_case + str(case_no) + " "
01343 message = message + "Connect(out->in, new,NEW) -> Disconnect"
01344 message = message + g_mess_footer
01345 fout.write(message + '\n')
01346 fout.close()
01347 print message
01348
01349 for i in range(loop_count):
01350
01351
01352 make_connecter_profile("new", "NEW", 0)
01353
01354
01355
01356 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01357
01358
01359 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01360
01361
01362 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01363
01364 time.sleep(sleep_connect_time)
01365
01366
01367 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01368 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01369 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01370
01371
01372 fout = open(g_test_result_file, 'a')
01373 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01374 message = message + g_test_ok
01375 print message
01376 fout.write(message + '\n')
01377 fout.close()
01378
01379 time.sleep(sleep_for_time)
01380
01381
01382
01383
01384 case_no = case_no + 1
01385 fout = open(g_test_result_file, 'a')
01386 message = g_mess_header + g_test_case + str(case_no) + " "
01387 message = message + "Connect(out->in, new,SKIP) -> Disconnect"
01388 message = message + g_mess_footer
01389 fout.write(message + '\n')
01390 fout.close()
01391 print message
01392
01393 for i in range(loop_count):
01394
01395
01396 make_connecter_profile("new", "SKIP", 0)
01397
01398
01399
01400 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01401
01402
01403 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01404
01405
01406 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01407
01408 time.sleep(sleep_connect_time)
01409
01410
01411 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01412 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01413 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01414
01415
01416 fout = open(g_test_result_file, 'a')
01417 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01418 message = message + g_test_ok
01419 print message
01420 fout.write(message + '\n')
01421 fout.close()
01422
01423 time.sleep(sleep_for_time)
01424
01425
01426
01427
01428 case_no = case_no + 1
01429 fout = open(g_test_result_file, 'a')
01430 message = g_mess_header + g_test_case + str(case_no) + " "
01431 message = message + "Connect(in->out, new,ALL) -> Disconnect"
01432 message = message + g_mess_footer
01433 fout.write(message + '\n')
01434 fout.close()
01435 print message
01436
01437 for i in range(loop_count):
01438
01439
01440 make_connecter_profile("new", "ALL", 1)
01441
01442
01443
01444 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01445
01446
01447 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01448
01449
01450 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01451
01452 time.sleep(sleep_connect_time)
01453
01454
01455 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01456 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01457 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01458
01459
01460 fout = open(g_test_result_file, 'a')
01461 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01462 message = message + g_test_ok
01463 print message
01464 fout.write(message + '\n')
01465 fout.close()
01466
01467 time.sleep(sleep_for_time)
01468
01469
01470
01471
01472 case_no = case_no + 1
01473 fout = open(g_test_result_file, 'a')
01474 message = g_mess_header + g_test_case + str(case_no) + " "
01475 message = message + "Connect(in->out, new,FIFO) -> Disconnect"
01476 message = message + g_mess_footer
01477 fout.write(message + '\n')
01478 fout.close()
01479 print message
01480
01481 for i in range(loop_count):
01482
01483
01484 make_connecter_profile("new", "FIFO", 1)
01485
01486
01487
01488 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01489
01490
01491 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01492
01493
01494 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01495
01496 time.sleep(sleep_connect_time)
01497
01498
01499 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01500 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01501 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01502
01503
01504 fout = open(g_test_result_file, 'a')
01505 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01506 message = message + g_test_ok
01507 print message
01508 fout.write(message + '\n')
01509 fout.close()
01510
01511 time.sleep(sleep_for_time)
01512
01513
01514
01515
01516 case_no = case_no + 1
01517 fout = open(g_test_result_file, 'a')
01518 message = g_mess_header + g_test_case + str(case_no) + " "
01519 message = message + "Connect(in->out, new,NEW) -> Disconnect"
01520 message = message + g_mess_footer
01521 fout.write(message + '\n')
01522 fout.close()
01523 print message
01524
01525 for i in range(loop_count):
01526
01527
01528 make_connecter_profile("new", "NEW", 1)
01529
01530
01531
01532 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01533
01534
01535 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01536
01537
01538 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01539
01540 time.sleep(sleep_connect_time)
01541
01542
01543 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01544 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01545 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01546
01547
01548 fout = open(g_test_result_file, 'a')
01549 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01550 message = message + g_test_ok
01551 print message
01552 fout.write(message + '\n')
01553 fout.close()
01554
01555 time.sleep(sleep_for_time)
01556
01557
01558
01559
01560 case_no = case_no + 1
01561 fout = open(g_test_result_file, 'a')
01562 message = g_mess_header + g_test_case + str(case_no) + " "
01563 message = message + "Connect(in->out, new,SKIP) -> Disconnect"
01564 message = message + g_mess_footer
01565 fout.write(message + '\n')
01566 fout.close()
01567 print message
01568
01569 for i in range(loop_count):
01570
01571
01572 make_connecter_profile("new", "SKIP", 1)
01573
01574
01575
01576 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01577
01578
01579 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01580
01581
01582 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01583
01584 time.sleep(sleep_connect_time)
01585
01586
01587 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01588 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01589 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01590
01591
01592 fout = open(g_test_result_file, 'a')
01593 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01594 message = message + g_test_ok
01595 print message
01596 fout.write(message + '\n')
01597 fout.close()
01598
01599 time.sleep(sleep_for_time)
01600
01601
01602
01603
01604 case_no = case_no + 1
01605 fout = open(g_test_result_file, 'a')
01606 message = g_mess_header + g_test_case + str(case_no) + " "
01607 message = message + "Connecting(out->in, new,ALL), Activate -> send/recv -> Deactivate"
01608 message = message + g_mess_footer
01609 fout.write(message + '\n')
01610 fout.close()
01611 print message
01612
01613
01614 make_connecter_profile("new", "ALL", 0)
01615
01616
01617
01618 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01619
01620
01621 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01622
01623
01624 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01625
01626 for i in range(loop_count):
01627
01628
01629 delete_recv_file()
01630
01631
01632 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01633 time.sleep(sleep_recv_act_time)
01634 ec_send[0].activate_component(g_compo_send.rtc_ref)
01635
01636 time.sleep(sleep_act_time)
01637
01638
01639 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01640 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01641
01642
01643 if os.path.isfile(g_diff_recv_file) == False:
01644 fout = open(g_test_result_file, 'a')
01645 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01646 message = message + g_check_message
01647 fout.write(message + '\n')
01648 fout.close()
01649 print message
01650 time.sleep(sleep_for_time)
01651 continue
01652
01653
01654 time.sleep(sleep_act_time)
01655 bret = diff_file()
01656
01657
01658 fout = open(g_test_result_file, 'a')
01659 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01660
01661 if bret == True:
01662
01663 message = message + g_test_ok
01664 print message
01665 fout.write(message + '\n')
01666 else:
01667
01668 message = message + g_test_ng
01669 print message
01670 message = message + g_test_ng_message
01671 fout.write(message + '\n')
01672
01673 fin2 = open(g_diff_recv_file, 'r')
01674 while(1):
01675 s2 = fin2.readline()
01676 if len(s2) == 0:
01677 break
01678 fout.write(s2)
01679 fin2.close()
01680 fout.close()
01681
01682 time.sleep(sleep_for_time)
01683
01684
01685 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01686 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01687 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01688
01689
01690
01691
01692 case_no = case_no + 1
01693 fout = open(g_test_result_file, 'a')
01694 message = g_mess_header + g_test_case + str(case_no) + " "
01695 message = message + "Connecting(out->in, new,FIFO), Activate -> send/recv -> Deactivate"
01696 message = message + g_mess_footer
01697 fout.write(message + '\n')
01698 fout.close()
01699 print message
01700
01701
01702 make_connecter_profile("new", "FIFO", 0)
01703
01704
01705
01706 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01707
01708
01709 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01710
01711
01712 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01713
01714 for i in range(loop_count):
01715
01716
01717 delete_recv_file()
01718
01719
01720 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01721 time.sleep(sleep_recv_act_time)
01722 ec_send[0].activate_component(g_compo_send.rtc_ref)
01723
01724 time.sleep(sleep_act_time)
01725
01726
01727 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01728 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01729
01730
01731 if os.path.isfile(g_diff_recv_file) == False:
01732 fout = open(g_test_result_file, 'a')
01733 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01734 message = message + g_check_message
01735 fout.write(message + '\n')
01736 fout.close()
01737 print message
01738 time.sleep(sleep_for_time)
01739 continue
01740
01741
01742 time.sleep(sleep_act_time)
01743 bret = diff_file()
01744
01745
01746 fout = open(g_test_result_file, 'a')
01747 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01748
01749 if bret == True:
01750
01751 message = message + g_test_ok
01752 print message
01753 fout.write(message + '\n')
01754 else:
01755
01756 message = message + g_test_ng
01757 print message
01758 message = message + g_test_ng_message
01759 fout.write(message + '\n')
01760
01761 fin2 = open(g_diff_recv_file, 'r')
01762 while(1):
01763 s2 = fin2.readline()
01764 if len(s2) == 0:
01765 break
01766 fout.write(s2)
01767 fin2.close()
01768 fout.close()
01769
01770 time.sleep(sleep_for_time)
01771
01772
01773 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01774 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01775 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01776
01777
01778
01779
01780 case_no = case_no + 1
01781 fout = open(g_test_result_file, 'a')
01782 message = g_mess_header + g_test_case + str(case_no) + " "
01783 message = message + "Connecting(out->in, new,NEW), Activate -> send/recv -> Deactivate"
01784 message = message + g_mess_footer
01785 fout.write(message + '\n')
01786 fout.close()
01787 print message
01788
01789
01790 make_connecter_profile("new", "NEW", 0)
01791
01792
01793
01794 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01795
01796
01797 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01798
01799
01800 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01801
01802 for i in range(loop_count):
01803
01804
01805 delete_recv_file()
01806
01807
01808 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01809 time.sleep(sleep_recv_act_time)
01810 ec_send[0].activate_component(g_compo_send.rtc_ref)
01811
01812 time.sleep(sleep_act_time)
01813
01814
01815 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01816 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01817
01818
01819 if os.path.isfile(g_diff_recv_file) == False:
01820 fout = open(g_test_result_file, 'a')
01821 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01822 message = message + g_check_message
01823 fout.write(message + '\n')
01824 fout.close()
01825 print message
01826 time.sleep(sleep_for_time)
01827 continue
01828
01829
01830 time.sleep(sleep_act_time)
01831 bret = diff_file()
01832
01833
01834 fout = open(g_test_result_file, 'a')
01835 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01836
01837 if bret == True:
01838
01839 message = message + g_test_ok
01840 print message
01841 fout.write(message + '\n')
01842 else:
01843
01844 message = message + g_test_ng
01845 print message
01846 message = message + g_test_ng_message
01847 fout.write(message + '\n')
01848
01849 fin2 = open(g_diff_recv_file, 'r')
01850 while(1):
01851 s2 = fin2.readline()
01852 if len(s2) == 0:
01853 break
01854 fout.write(s2)
01855 fin2.close()
01856 fout.close()
01857
01858 time.sleep(sleep_for_time)
01859
01860
01861 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01862 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01863 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01864
01865
01866
01867
01868 case_no = case_no + 1
01869 fout = open(g_test_result_file, 'a')
01870 message = g_mess_header + g_test_case + str(case_no) + " "
01871 message = message + "Connecting(out->in, new,SKIP), Activate -> send/recv -> Deactivate"
01872 message = message + g_mess_footer
01873 fout.write(message + '\n')
01874 fout.close()
01875 print message
01876
01877
01878 make_connecter_profile("new", "SKIP", 0)
01879
01880
01881
01882 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01883
01884
01885 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01886
01887
01888 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01889
01890 for i in range(loop_count):
01891
01892
01893 delete_recv_file()
01894
01895
01896 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01897 time.sleep(sleep_recv_act_time)
01898 ec_send[0].activate_component(g_compo_send.rtc_ref)
01899
01900 time.sleep(sleep_act_time)
01901
01902
01903 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01904 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01905
01906
01907 if os.path.isfile(g_diff_recv_file) == False:
01908 fout = open(g_test_result_file, 'a')
01909 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01910 message = message + g_check_message
01911 fout.write(message + '\n')
01912 fout.close()
01913 print message
01914 time.sleep(sleep_for_time)
01915 continue
01916
01917
01918 time.sleep(sleep_act_time)
01919 bret = diff_file()
01920
01921
01922 fout = open(g_test_result_file, 'a')
01923 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01924
01925 if bret == True:
01926
01927 message = message + g_test_ok
01928 print message
01929 fout.write(message + '\n')
01930 else:
01931
01932 message = message + g_test_ng
01933 print message
01934 message = message + g_test_ng_message
01935 fout.write(message + '\n')
01936
01937 fin2 = open(g_diff_recv_file, 'r')
01938 while(1):
01939 s2 = fin2.readline()
01940 if len(s2) == 0:
01941 break
01942 fout.write(s2)
01943 fin2.close()
01944 fout.close()
01945
01946 time.sleep(sleep_for_time)
01947
01948
01949 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
01950 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
01951 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
01952
01953
01954
01955
01956 case_no = case_no + 1
01957 fout = open(g_test_result_file, 'a')
01958 message = g_mess_header + g_test_case + str(case_no) + " "
01959 message = message + "Connecting(in->out, new,ALL), Activate -> send/recv -> Deactivate"
01960 message = message + g_mess_footer
01961 fout.write(message + '\n')
01962 fout.close()
01963 print message
01964
01965
01966 make_connecter_profile("new", "ALL", 1)
01967
01968
01969
01970 ret0 = g_out_ports[g_port1].connect(g_conprof1)
01971
01972
01973 ret1 = g_out_ports[g_port2].connect(g_conprof2)
01974
01975
01976 ret2 = g_out_ports[g_port3].connect(g_conprof3)
01977
01978 for i in range(loop_count):
01979
01980
01981 delete_recv_file()
01982
01983
01984 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
01985 time.sleep(sleep_recv_act_time)
01986 ec_send[0].activate_component(g_compo_send.rtc_ref)
01987
01988 time.sleep(sleep_act_time)
01989
01990
01991 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
01992 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
01993
01994
01995 if os.path.isfile(g_diff_recv_file) == False:
01996 fout = open(g_test_result_file, 'a')
01997 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
01998 message = message + g_check_message
01999 fout.write(message + '\n')
02000 fout.close()
02001 print message
02002 time.sleep(sleep_for_time)
02003 continue
02004
02005
02006 time.sleep(sleep_act_time)
02007 bret = diff_file()
02008
02009
02010 fout = open(g_test_result_file, 'a')
02011 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02012
02013 if bret == True:
02014
02015 message = message + g_test_ok
02016 print message
02017 fout.write(message + '\n')
02018 else:
02019
02020 message = message + g_test_ng
02021 print message
02022 message = message + g_test_ng_message
02023 fout.write(message + '\n')
02024
02025 fin2 = open(g_diff_recv_file, 'r')
02026 while(1):
02027 s2 = fin2.readline()
02028 if len(s2) == 0:
02029 break
02030 fout.write(s2)
02031 fin2.close()
02032 fout.close()
02033
02034 time.sleep(sleep_for_time)
02035
02036
02037 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02038 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02039 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02040
02041
02042
02043
02044 case_no = case_no + 1
02045 fout = open(g_test_result_file, 'a')
02046 message = g_mess_header + g_test_case + str(case_no) + " "
02047 message = message + "Connecting(in->out, new,FIFO), Activate -> send/recv -> Deactivate"
02048 message = message + g_mess_footer
02049 fout.write(message + '\n')
02050 fout.close()
02051 print message
02052
02053
02054 make_connecter_profile("new", "FIFO", 1)
02055
02056
02057
02058 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02059
02060
02061 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02062
02063
02064 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02065
02066 for i in range(loop_count):
02067
02068
02069 delete_recv_file()
02070
02071
02072 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02073 time.sleep(sleep_recv_act_time)
02074 ec_send[0].activate_component(g_compo_send.rtc_ref)
02075
02076 time.sleep(sleep_act_time)
02077
02078
02079 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02080 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02081
02082
02083 if os.path.isfile(g_diff_recv_file) == False:
02084 fout = open(g_test_result_file, 'a')
02085 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02086 message = message + g_check_message
02087 fout.write(message + '\n')
02088 fout.close()
02089 print message
02090 time.sleep(sleep_for_time)
02091 continue
02092
02093
02094 time.sleep(sleep_act_time)
02095 bret = diff_file()
02096
02097
02098 fout = open(g_test_result_file, 'a')
02099 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02100
02101 if bret == True:
02102
02103 message = message + g_test_ok
02104 print message
02105 fout.write(message + '\n')
02106 else:
02107
02108 message = message + g_test_ng
02109 print message
02110 message = message + g_test_ng_message
02111 fout.write(message + '\n')
02112
02113 fin2 = open(g_diff_recv_file, 'r')
02114 while(1):
02115 s2 = fin2.readline()
02116 if len(s2) == 0:
02117 break
02118 fout.write(s2)
02119 fin2.close()
02120 fout.close()
02121
02122 time.sleep(sleep_for_time)
02123
02124
02125 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02126 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02127 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02128
02129
02130
02131
02132 case_no = case_no + 1
02133 fout = open(g_test_result_file, 'a')
02134 message = g_mess_header + g_test_case + str(case_no) + " "
02135 message = message + "Connecting(in->out, new,NEW), Activate -> send/recv -> Deactivate"
02136 message = message + g_mess_footer
02137 fout.write(message + '\n')
02138 fout.close()
02139 print message
02140
02141
02142 make_connecter_profile("new", "NEW", 1)
02143
02144
02145
02146 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02147
02148
02149 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02150
02151
02152 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02153
02154 for i in range(loop_count):
02155
02156
02157 delete_recv_file()
02158
02159
02160 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02161 time.sleep(sleep_recv_act_time)
02162 ec_send[0].activate_component(g_compo_send.rtc_ref)
02163
02164 time.sleep(sleep_act_time)
02165
02166
02167 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02168 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02169
02170
02171 if os.path.isfile(g_diff_recv_file) == False:
02172 fout = open(g_test_result_file, 'a')
02173 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02174 message = message + g_check_message
02175 fout.write(message + '\n')
02176 fout.close()
02177 print message
02178 time.sleep(sleep_for_time)
02179 continue
02180
02181
02182 time.sleep(sleep_act_time)
02183 bret = diff_file()
02184
02185
02186 fout = open(g_test_result_file, 'a')
02187 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02188
02189 if bret == True:
02190
02191 message = message + g_test_ok
02192 print message
02193 fout.write(message + '\n')
02194 else:
02195
02196 message = message + g_test_ng
02197 print message
02198 message = message + g_test_ng_message
02199 fout.write(message + '\n')
02200
02201 fin2 = open(g_diff_recv_file, 'r')
02202 while(1):
02203 s2 = fin2.readline()
02204 if len(s2) == 0:
02205 break
02206 fout.write(s2)
02207 fin2.close()
02208 fout.close()
02209
02210 time.sleep(sleep_for_time)
02211
02212
02213 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02214 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02215 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02216
02217
02218
02219
02220 case_no = case_no + 1
02221 fout = open(g_test_result_file, 'a')
02222 message = g_mess_header + g_test_case + str(case_no) + " "
02223 message = message + "Connecting(in->out, new,SKIP), Activate -> send/recv -> Deactivate"
02224 message = message + g_mess_footer
02225 fout.write(message + '\n')
02226 fout.close()
02227 print message
02228
02229
02230 make_connecter_profile("new", "SKIP", 1)
02231
02232
02233
02234 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02235
02236
02237 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02238
02239
02240 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02241
02242 for i in range(loop_count):
02243
02244
02245 delete_recv_file()
02246
02247
02248 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02249 time.sleep(sleep_recv_act_time)
02250 ec_send[0].activate_component(g_compo_send.rtc_ref)
02251
02252 time.sleep(sleep_act_time)
02253
02254
02255 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02256 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02257
02258
02259 if os.path.isfile(g_diff_recv_file) == False:
02260 fout = open(g_test_result_file, 'a')
02261 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02262 message = message + g_check_message
02263 fout.write(message + '\n')
02264 fout.close()
02265 print message
02266 time.sleep(sleep_for_time)
02267 continue
02268
02269
02270 time.sleep(sleep_act_time)
02271 bret = diff_file()
02272
02273
02274 fout = open(g_test_result_file, 'a')
02275 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02276
02277 if bret == True:
02278
02279 message = message + g_test_ok
02280 print message
02281 fout.write(message + '\n')
02282 else:
02283
02284 message = message + g_test_ng
02285 print message
02286 message = message + g_test_ng_message
02287 fout.write(message + '\n')
02288
02289 fin2 = open(g_diff_recv_file, 'r')
02290 while(1):
02291 s2 = fin2.readline()
02292 if len(s2) == 0:
02293 break
02294 fout.write(s2)
02295 fin2.close()
02296 fout.close()
02297
02298 time.sleep(sleep_for_time)
02299
02300
02301 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02302 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02303 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02304
02305
02306
02307
02308 case_no = case_no + 1
02309 fout = open(g_test_result_file, 'a')
02310 message = g_mess_header + g_test_case + str(case_no) + " "
02311 message = message + "Connect(out->in, new,ALL) -> Activate -> send/recv -> Deactivate -> Disconnect"
02312 message = message + g_mess_footer
02313 fout.write(message + '\n')
02314 fout.close()
02315 print message
02316
02317 for i in range(loop_count):
02318
02319
02320 delete_recv_file()
02321
02322
02323 make_connecter_profile("new", "ALL", 0)
02324
02325
02326
02327 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02328
02329
02330 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02331
02332
02333 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02334
02335
02336 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02337 time.sleep(sleep_recv_act_time)
02338 ec_send[0].activate_component(g_compo_send.rtc_ref)
02339
02340 time.sleep(sleep_act_time)
02341
02342
02343 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02344 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02345
02346
02347 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02348 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02349 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02350
02351
02352 if os.path.isfile(g_diff_recv_file) == False:
02353 fout = open(g_test_result_file, 'a')
02354 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02355 message = message + g_check_message
02356 fout.write(message + '\n')
02357 fout.close()
02358 print message
02359 time.sleep(sleep_for_time)
02360 continue
02361
02362
02363 time.sleep(sleep_act_time)
02364 bret = diff_file()
02365
02366
02367 fout = open(g_test_result_file, 'a')
02368 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02369
02370 if bret == True:
02371
02372 message = message + g_test_ok
02373 print message
02374 fout.write(message + '\n')
02375 else:
02376
02377 message = message + g_test_ng
02378 print message
02379 message = message + g_test_ng_message
02380 fout.write(message + '\n')
02381
02382 fin2 = open(g_diff_recv_file, 'r')
02383 while(1):
02384 s2 = fin2.readline()
02385 if len(s2) == 0:
02386 break
02387 fout.write(s2)
02388 fin2.close()
02389 fout.close()
02390
02391 time.sleep(sleep_for_time)
02392
02393
02394
02395
02396 case_no = case_no + 1
02397 fout = open(g_test_result_file, 'a')
02398 message = g_mess_header + g_test_case + str(case_no) + " "
02399 message = message + "Connect(out->in, new,FIFO) -> Activate -> send/recv -> Deactivate -> Disconnect"
02400 message = message + g_mess_footer
02401 fout.write(message + '\n')
02402 fout.close()
02403 print message
02404
02405 for i in range(loop_count):
02406
02407
02408 delete_recv_file()
02409
02410
02411 make_connecter_profile("new", "FIFO", 0)
02412
02413
02414
02415 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02416
02417
02418 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02419
02420
02421 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02422
02423
02424 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02425 time.sleep(sleep_recv_act_time)
02426 ec_send[0].activate_component(g_compo_send.rtc_ref)
02427
02428 time.sleep(sleep_act_time)
02429
02430
02431 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02432 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02433
02434
02435 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02436 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02437 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02438
02439
02440 if os.path.isfile(g_diff_recv_file) == False:
02441 fout = open(g_test_result_file, 'a')
02442 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02443 message = message + g_check_message
02444 fout.write(message + '\n')
02445 fout.close()
02446 print message
02447 time.sleep(sleep_for_time)
02448 continue
02449
02450
02451 time.sleep(sleep_act_time)
02452 bret = diff_file()
02453
02454
02455 fout = open(g_test_result_file, 'a')
02456 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02457
02458 if bret == True:
02459
02460 message = message + g_test_ok
02461 print message
02462 fout.write(message + '\n')
02463 else:
02464
02465 message = message + g_test_ng
02466 print message
02467 message = message + g_test_ng_message
02468 fout.write(message + '\n')
02469
02470 fin2 = open(g_diff_recv_file, 'r')
02471 while(1):
02472 s2 = fin2.readline()
02473 if len(s2) == 0:
02474 break
02475 fout.write(s2)
02476 fin2.close()
02477 fout.close()
02478
02479 time.sleep(sleep_for_time)
02480
02481
02482
02483
02484 case_no = case_no + 1
02485 fout = open(g_test_result_file, 'a')
02486 message = g_mess_header + g_test_case + str(case_no) + " "
02487 message = message + "Connect(out->in, new,NEW) -> Activate -> send/recv -> Deactivate -> Disconnect"
02488 message = message + g_mess_footer
02489 fout.write(message + '\n')
02490 fout.close()
02491 print message
02492
02493 for i in range(loop_count):
02494
02495
02496 delete_recv_file()
02497
02498
02499 make_connecter_profile("new", "NEW", 0)
02500
02501
02502
02503 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02504
02505
02506 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02507
02508
02509 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02510
02511
02512 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02513 time.sleep(sleep_recv_act_time)
02514 ec_send[0].activate_component(g_compo_send.rtc_ref)
02515
02516 time.sleep(sleep_act_time)
02517
02518
02519 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02520 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02521
02522
02523 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02524 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02525 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02526
02527
02528 if os.path.isfile(g_diff_recv_file) == False:
02529 fout = open(g_test_result_file, 'a')
02530 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02531 message = message + g_check_message
02532 fout.write(message + '\n')
02533 fout.close()
02534 print message
02535 time.sleep(sleep_for_time)
02536 continue
02537
02538
02539 time.sleep(sleep_act_time)
02540 bret = diff_file()
02541
02542
02543 fout = open(g_test_result_file, 'a')
02544 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02545
02546 if bret == True:
02547
02548 message = message + g_test_ok
02549 print message
02550 fout.write(message + '\n')
02551 else:
02552
02553 message = message + g_test_ng
02554 print message
02555 message = message + g_test_ng_message
02556 fout.write(message + '\n')
02557
02558 fin2 = open(g_diff_recv_file, 'r')
02559 while(1):
02560 s2 = fin2.readline()
02561 if len(s2) == 0:
02562 break
02563 fout.write(s2)
02564 fin2.close()
02565 fout.close()
02566
02567 time.sleep(sleep_for_time)
02568
02569
02570
02571
02572 case_no = case_no + 1
02573 fout = open(g_test_result_file, 'a')
02574 message = g_mess_header + g_test_case + str(case_no) + " "
02575 message = message + "Connect(out->in, new,SKIP) -> Activate -> send/recv -> Deactivate -> Disconnect"
02576 message = message + g_mess_footer
02577 fout.write(message + '\n')
02578 fout.close()
02579 print message
02580
02581 for i in range(loop_count):
02582
02583
02584 delete_recv_file()
02585
02586
02587 make_connecter_profile("new", "SKIP", 0)
02588
02589
02590
02591 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02592
02593
02594 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02595
02596
02597 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02598
02599
02600 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02601 time.sleep(sleep_recv_act_time)
02602 ec_send[0].activate_component(g_compo_send.rtc_ref)
02603
02604 time.sleep(sleep_act_time)
02605
02606
02607 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02608 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02609
02610
02611 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02612 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02613 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02614
02615
02616 if os.path.isfile(g_diff_recv_file) == False:
02617 fout = open(g_test_result_file, 'a')
02618 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02619 message = message + g_check_message
02620 fout.write(message + '\n')
02621 fout.close()
02622 print message
02623 time.sleep(sleep_for_time)
02624 continue
02625
02626
02627 time.sleep(sleep_act_time)
02628 bret = diff_file()
02629
02630
02631 fout = open(g_test_result_file, 'a')
02632 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02633
02634 if bret == True:
02635
02636 message = message + g_test_ok
02637 print message
02638 fout.write(message + '\n')
02639 else:
02640
02641 message = message + g_test_ng
02642 print message
02643 message = message + g_test_ng_message
02644 fout.write(message + '\n')
02645
02646 fin2 = open(g_diff_recv_file, 'r')
02647 while(1):
02648 s2 = fin2.readline()
02649 if len(s2) == 0:
02650 break
02651 fout.write(s2)
02652 fin2.close()
02653 fout.close()
02654
02655 time.sleep(sleep_for_time)
02656
02657
02658
02659
02660 case_no = case_no + 1
02661 fout = open(g_test_result_file, 'a')
02662 message = g_mess_header + g_test_case + str(case_no) + " "
02663 message = message + "Connect(in->out, new,ALL) -> Activate -> send/recv -> Deactivate -> Disconnect"
02664 message = message + g_mess_footer
02665 fout.write(message + '\n')
02666 fout.close()
02667 print message
02668
02669 for i in range(loop_count):
02670
02671
02672 delete_recv_file()
02673
02674
02675 make_connecter_profile("new", "ALL", 1)
02676
02677
02678
02679 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02680
02681
02682 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02683
02684
02685 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02686
02687
02688 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02689 time.sleep(sleep_recv_act_time)
02690 ec_send[0].activate_component(g_compo_send.rtc_ref)
02691
02692 time.sleep(sleep_act_time)
02693
02694
02695 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02696 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02697
02698
02699 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02700 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02701 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02702
02703
02704 if os.path.isfile(g_diff_recv_file) == False:
02705 fout = open(g_test_result_file, 'a')
02706 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02707 message = message + g_check_message
02708 fout.write(message + '\n')
02709 fout.close()
02710 print message
02711 time.sleep(sleep_for_time)
02712 continue
02713
02714
02715 time.sleep(sleep_act_time)
02716 bret = diff_file()
02717
02718
02719 fout = open(g_test_result_file, 'a')
02720 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02721
02722 if bret == True:
02723
02724 message = message + g_test_ok
02725 print message
02726 fout.write(message + '\n')
02727 else:
02728
02729 message = message + g_test_ng
02730 print message
02731 message = message + g_test_ng_message
02732 fout.write(message + '\n')
02733
02734 fin2 = open(g_diff_recv_file, 'r')
02735 while(1):
02736 s2 = fin2.readline()
02737 if len(s2) == 0:
02738 break
02739 fout.write(s2)
02740 fin2.close()
02741 fout.close()
02742
02743 time.sleep(sleep_for_time)
02744
02745
02746
02747
02748 case_no = case_no + 1
02749 fout = open(g_test_result_file, 'a')
02750 message = g_mess_header + g_test_case + str(case_no) + " "
02751 message = message + "Connect(in->out, new,FIFO) -> Activate -> send/recv -> Deactivate -> Disconnect"
02752 message = message + g_mess_footer
02753 fout.write(message + '\n')
02754 fout.close()
02755 print message
02756
02757 for i in range(loop_count):
02758
02759
02760 delete_recv_file()
02761
02762
02763 make_connecter_profile("new", "FIFO", 1)
02764
02765
02766
02767 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02768
02769
02770 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02771
02772
02773 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02774
02775
02776 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02777 time.sleep(sleep_recv_act_time)
02778 ec_send[0].activate_component(g_compo_send.rtc_ref)
02779
02780 time.sleep(sleep_act_time)
02781
02782
02783 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02784 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02785
02786
02787 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02788 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02789 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02790
02791
02792 if os.path.isfile(g_diff_recv_file) == False:
02793 fout = open(g_test_result_file, 'a')
02794 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02795 message = message + g_check_message
02796 fout.write(message + '\n')
02797 fout.close()
02798 print message
02799 time.sleep(sleep_for_time)
02800 continue
02801
02802
02803 time.sleep(sleep_act_time)
02804 bret = diff_file()
02805
02806
02807 fout = open(g_test_result_file, 'a')
02808 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02809
02810 if bret == True:
02811
02812 message = message + g_test_ok
02813 print message
02814 fout.write(message + '\n')
02815 else:
02816
02817 message = message + g_test_ng
02818 print message
02819 message = message + g_test_ng_message
02820 fout.write(message + '\n')
02821
02822 fin2 = open(g_diff_recv_file, 'r')
02823 while(1):
02824 s2 = fin2.readline()
02825 if len(s2) == 0:
02826 break
02827 fout.write(s2)
02828 fin2.close()
02829 fout.close()
02830
02831 time.sleep(sleep_for_time)
02832
02833
02834
02835
02836 case_no = case_no + 1
02837 fout = open(g_test_result_file, 'a')
02838 message = g_mess_header + g_test_case + str(case_no) + " "
02839 message = message + "Connect(in->out, new,NEW) -> Activate -> send/recv -> Deactivate -> Disconnect"
02840 message = message + g_mess_footer
02841 fout.write(message + '\n')
02842 fout.close()
02843 print message
02844
02845 for i in range(loop_count):
02846
02847
02848 delete_recv_file()
02849
02850
02851 make_connecter_profile("new", "NEW", 1)
02852
02853
02854
02855 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02856
02857
02858 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02859
02860
02861 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02862
02863
02864 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02865 time.sleep(sleep_recv_act_time)
02866 ec_send[0].activate_component(g_compo_send.rtc_ref)
02867
02868 time.sleep(sleep_act_time)
02869
02870
02871 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02872 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02873
02874
02875 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02876 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02877 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02878
02879
02880 if os.path.isfile(g_diff_recv_file) == False:
02881 fout = open(g_test_result_file, 'a')
02882 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02883 message = message + g_check_message
02884 fout.write(message + '\n')
02885 fout.close()
02886 print message
02887 time.sleep(sleep_for_time)
02888 continue
02889
02890
02891 time.sleep(sleep_act_time)
02892 bret = diff_file()
02893
02894
02895 fout = open(g_test_result_file, 'a')
02896 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02897
02898 if bret == True:
02899
02900 message = message + g_test_ok
02901 print message
02902 fout.write(message + '\n')
02903 else:
02904
02905 message = message + g_test_ng
02906 print message
02907 message = message + g_test_ng_message
02908 fout.write(message + '\n')
02909
02910 fin2 = open(g_diff_recv_file, 'r')
02911 while(1):
02912 s2 = fin2.readline()
02913 if len(s2) == 0:
02914 break
02915 fout.write(s2)
02916 fin2.close()
02917 fout.close()
02918
02919 time.sleep(sleep_for_time)
02920
02921
02922
02923
02924 case_no = case_no + 1
02925 fout = open(g_test_result_file, 'a')
02926 message = g_mess_header + g_test_case + str(case_no) + " "
02927 message = message + "Connect(in->out, new,SKIP) -> Activate -> send/recv -> Deactivate -> Disconnect"
02928 message = message + g_mess_footer
02929 fout.write(message + '\n')
02930 fout.close()
02931 print message
02932
02933 for i in range(loop_count):
02934
02935
02936 delete_recv_file()
02937
02938
02939 make_connecter_profile("new", "SKIP", 1)
02940
02941
02942
02943 ret0 = g_out_ports[g_port1].connect(g_conprof1)
02944
02945
02946 ret1 = g_out_ports[g_port2].connect(g_conprof2)
02947
02948
02949 ret2 = g_out_ports[g_port3].connect(g_conprof3)
02950
02951
02952 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
02953 time.sleep(sleep_recv_act_time)
02954 ec_send[0].activate_component(g_compo_send.rtc_ref)
02955
02956 time.sleep(sleep_act_time)
02957
02958
02959 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
02960 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
02961
02962
02963 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
02964 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
02965 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
02966
02967
02968 if os.path.isfile(g_diff_recv_file) == False:
02969 fout = open(g_test_result_file, 'a')
02970 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02971 message = message + g_check_message
02972 fout.write(message + '\n')
02973 fout.close()
02974 print message
02975 time.sleep(sleep_for_time)
02976 continue
02977
02978
02979 time.sleep(sleep_act_time)
02980 bret = diff_file()
02981
02982
02983 fout = open(g_test_result_file, 'a')
02984 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
02985
02986 if bret == True:
02987
02988 message = message + g_test_ok
02989 print message
02990 fout.write(message + '\n')
02991 else:
02992
02993 message = message + g_test_ng
02994 print message
02995 message = message + g_test_ng_message
02996 fout.write(message + '\n')
02997
02998 fin2 = open(g_diff_recv_file, 'r')
02999 while(1):
03000 s2 = fin2.readline()
03001 if len(s2) == 0:
03002 break
03003 fout.write(s2)
03004 fin2.close()
03005 fout.close()
03006
03007 time.sleep(sleep_for_time)
03008
03009
03010
03011
03012
03013 case_no = case_no + 1
03014 fout = open(g_test_result_file, 'a')
03015 message = g_mess_header + g_test_case + str(case_no) + " "
03016 message = message + "Connect(out->in, periodic,ALL) -> Disconnect"
03017 message = message + g_mess_footer
03018 fout.write(message + '\n')
03019 fout.close()
03020 print message
03021
03022 for i in range(loop_count):
03023
03024
03025 make_connecter_profile("periodic", "ALL", 0)
03026
03027
03028
03029 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03030
03031
03032 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03033
03034
03035 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03036
03037 time.sleep(sleep_connect_time)
03038
03039
03040 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03041 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03042 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03043
03044
03045 fout = open(g_test_result_file, 'a')
03046 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03047 message = message + g_test_ok
03048 print message
03049 fout.write(message + '\n')
03050 fout.close()
03051
03052 time.sleep(sleep_for_time)
03053
03054
03055
03056
03057 case_no = case_no + 1
03058 fout = open(g_test_result_file, 'a')
03059 message = g_mess_header + g_test_case + str(case_no) + " "
03060 message = message + "Connect(out->in, periodic,FIFO) -> Disconnect"
03061 message = message + g_mess_footer
03062 fout.write(message + '\n')
03063 fout.close()
03064 print message
03065
03066 for i in range(loop_count):
03067
03068
03069 make_connecter_profile("periodic", "FIFO", 0)
03070
03071
03072
03073 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03074
03075
03076 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03077
03078
03079 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03080
03081 time.sleep(sleep_connect_time)
03082
03083
03084 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03085 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03086 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03087
03088
03089 fout = open(g_test_result_file, 'a')
03090 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03091 message = message + g_test_ok
03092 print message
03093 fout.write(message + '\n')
03094 fout.close()
03095
03096 time.sleep(sleep_for_time)
03097
03098
03099
03100
03101 case_no = case_no + 1
03102 fout = open(g_test_result_file, 'a')
03103 message = g_mess_header + g_test_case + str(case_no) + " "
03104 message = message + "Connect(out->in, periodic,NEW) -> Disconnect"
03105 message = message + g_mess_footer
03106 fout.write(message + '\n')
03107 fout.close()
03108 print message
03109
03110 for i in range(loop_count):
03111
03112
03113 make_connecter_profile("periodic", "NEW", 0)
03114
03115
03116
03117 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03118
03119
03120 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03121
03122
03123 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03124
03125 time.sleep(sleep_connect_time)
03126
03127
03128 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03129 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03130 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03131
03132
03133 fout = open(g_test_result_file, 'a')
03134 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03135 message = message + g_test_ok
03136 print message
03137 fout.write(message + '\n')
03138 fout.close()
03139
03140 time.sleep(sleep_for_time)
03141
03142
03143
03144
03145 case_no = case_no + 1
03146 fout = open(g_test_result_file, 'a')
03147 message = g_mess_header + g_test_case + str(case_no) + " "
03148 message = message + "Connect(out->in, periodic,SKIP) -> Disconnect"
03149 message = message + g_mess_footer
03150 fout.write(message + '\n')
03151 fout.close()
03152 print message
03153
03154 for i in range(loop_count):
03155
03156
03157 make_connecter_profile("periodic", "SKIP", 0)
03158
03159
03160
03161 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03162
03163
03164 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03165
03166
03167 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03168
03169 time.sleep(sleep_connect_time)
03170
03171
03172 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03173 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03174 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03175
03176
03177 fout = open(g_test_result_file, 'a')
03178 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03179 message = message + g_test_ok
03180 print message
03181 fout.write(message + '\n')
03182 fout.close()
03183
03184 time.sleep(sleep_for_time)
03185
03186
03187
03188
03189 case_no = case_no + 1
03190 fout = open(g_test_result_file, 'a')
03191 message = g_mess_header + g_test_case + str(case_no) + " "
03192 message = message + "Connect(in->out, periodic,ALL) -> Disconnect"
03193 message = message + g_mess_footer
03194 fout.write(message + '\n')
03195 fout.close()
03196 print message
03197
03198 for i in range(loop_count):
03199
03200
03201 make_connecter_profile("periodic", "ALL", 1)
03202
03203
03204
03205 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03206
03207
03208 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03209
03210
03211 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03212
03213 time.sleep(sleep_connect_time)
03214
03215
03216 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03217 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03218 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03219
03220
03221 fout = open(g_test_result_file, 'a')
03222 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03223 message = message + g_test_ok
03224 print message
03225 fout.write(message + '\n')
03226 fout.close()
03227
03228 time.sleep(sleep_for_time)
03229
03230
03231
03232
03233 case_no = case_no + 1
03234 fout = open(g_test_result_file, 'a')
03235 message = g_mess_header + g_test_case + str(case_no) + " "
03236 message = message + "Connect(in->out, periodic,FIFO) -> Disconnect"
03237 message = message + g_mess_footer
03238 fout.write(message + '\n')
03239 fout.close()
03240 print message
03241
03242 for i in range(loop_count):
03243
03244
03245 make_connecter_profile("periodic", "FIFO", 1)
03246
03247
03248
03249 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03250
03251
03252 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03253
03254
03255 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03256
03257 time.sleep(sleep_connect_time)
03258
03259
03260 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03261 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03262 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03263
03264
03265 fout = open(g_test_result_file, 'a')
03266 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03267 message = message + g_test_ok
03268 print message
03269 fout.write(message + '\n')
03270 fout.close()
03271
03272 time.sleep(sleep_for_time)
03273
03274
03275
03276
03277 case_no = case_no + 1
03278 fout = open(g_test_result_file, 'a')
03279 message = g_mess_header + g_test_case + str(case_no) + " "
03280 message = message + "Connect(in->out, periodic,NEW) -> Disconnect"
03281 message = message + g_mess_footer
03282 fout.write(message + '\n')
03283 fout.close()
03284 print message
03285
03286 for i in range(loop_count):
03287
03288
03289 make_connecter_profile("periodic", "NEW", 1)
03290
03291
03292
03293 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03294
03295
03296 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03297
03298
03299 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03300
03301 time.sleep(sleep_connect_time)
03302
03303
03304 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03305 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03306 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03307
03308
03309 fout = open(g_test_result_file, 'a')
03310 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03311 message = message + g_test_ok
03312 print message
03313 fout.write(message + '\n')
03314 fout.close()
03315
03316 time.sleep(sleep_for_time)
03317
03318
03319
03320
03321 case_no = case_no + 1
03322 fout = open(g_test_result_file, 'a')
03323 message = g_mess_header + g_test_case + str(case_no) + " "
03324 message = message + "Connect(in->out, periodic,SKIP) -> Disconnect"
03325 message = message + g_mess_footer
03326 fout.write(message + '\n')
03327 fout.close()
03328 print message
03329
03330 for i in range(loop_count):
03331
03332
03333 make_connecter_profile("periodic", "SKIP", 1)
03334
03335
03336
03337 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03338
03339
03340 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03341
03342
03343 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03344
03345 time.sleep(sleep_connect_time)
03346
03347
03348 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03349 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03350 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03351
03352
03353 fout = open(g_test_result_file, 'a')
03354 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03355 message = message + g_test_ok
03356 print message
03357 fout.write(message + '\n')
03358 fout.close()
03359
03360 time.sleep(sleep_for_time)
03361
03362
03363
03364
03365 case_no = case_no + 1
03366 fout = open(g_test_result_file, 'a')
03367 message = g_mess_header + g_test_case + str(case_no) + " "
03368 message = message + "Connecting(out->in, periodic,ALL), Activate -> send/recv -> Deactivate"
03369 message = message + g_mess_footer
03370 fout.write(message + '\n')
03371 fout.close()
03372 print message
03373
03374
03375 make_connecter_profile("periodic", "ALL", 0)
03376
03377
03378
03379 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03380
03381
03382 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03383
03384
03385 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03386
03387 for i in range(loop_count):
03388
03389
03390 delete_recv_file()
03391
03392
03393 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03394 time.sleep(sleep_recv_act_time)
03395 ec_send[0].activate_component(g_compo_send.rtc_ref)
03396
03397 time.sleep(sleep_act_time)
03398
03399
03400 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03401 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03402
03403
03404 if os.path.isfile(g_diff_recv_file) == False:
03405 fout = open(g_test_result_file, 'a')
03406 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03407 message = message + g_check_message
03408 fout.write(message + '\n')
03409 fout.close()
03410 print message
03411 time.sleep(sleep_for_time)
03412 continue
03413
03414
03415 time.sleep(sleep_act_time)
03416 bret = diff_file()
03417
03418
03419 fout = open(g_test_result_file, 'a')
03420 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03421
03422 if bret == True:
03423
03424 message = message + g_test_ok
03425 print message
03426 fout.write(message + '\n')
03427 else:
03428
03429 message = message + g_test_ng
03430 print message
03431 message = message + g_test_ng_message
03432 fout.write(message + '\n')
03433
03434 fin2 = open(g_diff_recv_file, 'r')
03435 while(1):
03436 s2 = fin2.readline()
03437 if len(s2) == 0:
03438 break
03439 fout.write(s2)
03440 fin2.close()
03441 fout.close()
03442
03443 time.sleep(sleep_for_time)
03444
03445
03446 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03447 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03448 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03449
03450
03451
03452
03453 case_no = case_no + 1
03454 fout = open(g_test_result_file, 'a')
03455 message = g_mess_header + g_test_case + str(case_no) + " "
03456 message = message + "Connecting(out->in, periodic,FIFO), Activate -> send/recv -> Deactivate"
03457 message = message + g_mess_footer
03458 fout.write(message + '\n')
03459 fout.close()
03460 print message
03461
03462
03463 make_connecter_profile("periodic", "FIFO", 0)
03464
03465
03466
03467 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03468
03469
03470 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03471
03472
03473 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03474
03475 for i in range(loop_count):
03476
03477
03478 delete_recv_file()
03479
03480
03481 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03482 time.sleep(sleep_recv_act_time)
03483 ec_send[0].activate_component(g_compo_send.rtc_ref)
03484
03485 time.sleep(sleep_act_time)
03486
03487
03488 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03489 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03490
03491
03492 if os.path.isfile(g_diff_recv_file) == False:
03493 fout = open(g_test_result_file, 'a')
03494 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03495 message = message + g_check_message
03496 fout.write(message + '\n')
03497 fout.close()
03498 print message
03499 time.sleep(sleep_for_time)
03500 continue
03501
03502
03503 time.sleep(sleep_act_time)
03504 bret = diff_file()
03505
03506
03507 fout = open(g_test_result_file, 'a')
03508 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03509
03510 if bret == True:
03511
03512 message = message + g_test_ok
03513 print message
03514 fout.write(message + '\n')
03515 else:
03516
03517 message = message + g_test_ng
03518 print message
03519 message = message + g_test_ng_message
03520 fout.write(message + '\n')
03521
03522 fin2 = open(g_diff_recv_file, 'r')
03523 while(1):
03524 s2 = fin2.readline()
03525 if len(s2) == 0:
03526 break
03527 fout.write(s2)
03528 fin2.close()
03529 fout.close()
03530
03531 time.sleep(sleep_for_time)
03532
03533
03534 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03535 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03536 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03537
03538
03539
03540
03541 case_no = case_no + 1
03542 fout = open(g_test_result_file, 'a')
03543 message = g_mess_header + g_test_case + str(case_no) + " "
03544 message = message + "Connecting(out->in, periodic,NEW), Activate -> send/recv -> Deactivate"
03545 message = message + g_mess_footer
03546 fout.write(message + '\n')
03547 fout.close()
03548 print message
03549
03550
03551 make_connecter_profile("periodic", "NEW", 0)
03552
03553
03554
03555 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03556
03557
03558 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03559
03560
03561 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03562
03563 for i in range(loop_count):
03564
03565
03566 delete_recv_file()
03567
03568
03569 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03570 time.sleep(sleep_recv_act_time)
03571 ec_send[0].activate_component(g_compo_send.rtc_ref)
03572
03573 time.sleep(sleep_act_time)
03574
03575
03576 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03577 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03578
03579
03580 if os.path.isfile(g_diff_recv_file) == False:
03581 fout = open(g_test_result_file, 'a')
03582 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03583 message = message + g_check_message
03584 fout.write(message + '\n')
03585 fout.close()
03586 print message
03587 time.sleep(sleep_for_time)
03588 continue
03589
03590
03591 time.sleep(sleep_act_time)
03592 bret = diff_file()
03593
03594
03595 fout = open(g_test_result_file, 'a')
03596 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03597
03598 if bret == True:
03599
03600 message = message + g_test_ok
03601 print message
03602 fout.write(message + '\n')
03603 else:
03604
03605 message = message + g_test_ng
03606 print message
03607 message = message + g_test_ng_message
03608 fout.write(message + '\n')
03609
03610 fin2 = open(g_diff_recv_file, 'r')
03611 while(1):
03612 s2 = fin2.readline()
03613 if len(s2) == 0:
03614 break
03615 fout.write(s2)
03616 fin2.close()
03617 fout.close()
03618
03619 time.sleep(sleep_for_time)
03620
03621
03622 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03623 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03624 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03625
03626
03627
03628
03629 case_no = case_no + 1
03630 fout = open(g_test_result_file, 'a')
03631 message = g_mess_header + g_test_case + str(case_no) + " "
03632 message = message + "Connecting(out->in, periodic,SKIP), Activate -> send/recv -> Deactivate"
03633 message = message + g_mess_footer
03634 fout.write(message + '\n')
03635 fout.close()
03636 print message
03637
03638
03639 make_connecter_profile("periodic", "SKIP", 0)
03640
03641
03642
03643 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03644
03645
03646 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03647
03648
03649 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03650
03651 for i in range(loop_count):
03652
03653
03654 delete_recv_file()
03655
03656
03657 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03658 time.sleep(sleep_recv_act_time)
03659 ec_send[0].activate_component(g_compo_send.rtc_ref)
03660
03661 time.sleep(sleep_act_time)
03662
03663
03664 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03665 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03666
03667
03668 if os.path.isfile(g_diff_recv_file) == False:
03669 fout = open(g_test_result_file, 'a')
03670 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03671 message = message + g_check_message
03672 fout.write(message + '\n')
03673 fout.close()
03674 print message
03675 time.sleep(sleep_for_time)
03676 continue
03677
03678
03679 time.sleep(sleep_act_time)
03680 bret = diff_file()
03681
03682
03683 fout = open(g_test_result_file, 'a')
03684 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03685
03686 if bret == True:
03687
03688 message = message + g_test_ok
03689 print message
03690 fout.write(message + '\n')
03691 else:
03692
03693 message = message + g_test_ng
03694 print message
03695 message = message + g_test_ng_message
03696 fout.write(message + '\n')
03697
03698 fin2 = open(g_diff_recv_file, 'r')
03699 while(1):
03700 s2 = fin2.readline()
03701 if len(s2) == 0:
03702 break
03703 fout.write(s2)
03704 fin2.close()
03705 fout.close()
03706
03707 time.sleep(sleep_for_time)
03708
03709
03710 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03711 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03712 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03713
03714
03715
03716
03717 case_no = case_no + 1
03718 fout = open(g_test_result_file, 'a')
03719 message = g_mess_header + g_test_case + str(case_no) + " "
03720 message = message + "Connecting(in->out, periodic,ALL), Activate -> send/recv -> Deactivate"
03721 message = message + g_mess_footer
03722 fout.write(message + '\n')
03723 fout.close()
03724 print message
03725
03726
03727 make_connecter_profile("periodic", "ALL", 1)
03728
03729
03730
03731 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03732
03733
03734 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03735
03736
03737 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03738
03739 for i in range(loop_count):
03740
03741
03742 delete_recv_file()
03743
03744
03745 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03746 time.sleep(sleep_recv_act_time)
03747 ec_send[0].activate_component(g_compo_send.rtc_ref)
03748
03749 time.sleep(sleep_act_time)
03750
03751
03752 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03753 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03754
03755
03756 if os.path.isfile(g_diff_recv_file) == False:
03757 fout = open(g_test_result_file, 'a')
03758 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03759 message = message + g_check_message
03760 fout.write(message + '\n')
03761 fout.close()
03762 print message
03763 time.sleep(sleep_for_time)
03764 continue
03765
03766
03767 time.sleep(sleep_act_time)
03768 bret = diff_file()
03769
03770
03771 fout = open(g_test_result_file, 'a')
03772 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03773
03774 if bret == True:
03775
03776 message = message + g_test_ok
03777 print message
03778 fout.write(message + '\n')
03779 else:
03780
03781 message = message + g_test_ng
03782 print message
03783 message = message + g_test_ng_message
03784 fout.write(message + '\n')
03785
03786 fin2 = open(g_diff_recv_file, 'r')
03787 while(1):
03788 s2 = fin2.readline()
03789 if len(s2) == 0:
03790 break
03791 fout.write(s2)
03792 fin2.close()
03793 fout.close()
03794
03795 time.sleep(sleep_for_time)
03796
03797
03798 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03799 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03800 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03801
03802
03803
03804
03805 case_no = case_no + 1
03806 fout = open(g_test_result_file, 'a')
03807 message = g_mess_header + g_test_case + str(case_no) + " "
03808 message = message + "Connecting(in->out, periodic,FIFO), Activate -> send/recv -> Deactivate"
03809 message = message + g_mess_footer
03810 fout.write(message + '\n')
03811 fout.close()
03812 print message
03813
03814
03815 make_connecter_profile("periodic", "FIFO", 1)
03816
03817
03818
03819 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03820
03821
03822 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03823
03824
03825 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03826
03827 for i in range(loop_count):
03828
03829
03830 delete_recv_file()
03831
03832
03833 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03834 time.sleep(sleep_recv_act_time)
03835 ec_send[0].activate_component(g_compo_send.rtc_ref)
03836
03837 time.sleep(sleep_act_time)
03838
03839
03840 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03841 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03842
03843
03844 if os.path.isfile(g_diff_recv_file) == False:
03845 fout = open(g_test_result_file, 'a')
03846 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03847 message = message + g_check_message
03848 fout.write(message + '\n')
03849 fout.close()
03850 print message
03851 time.sleep(sleep_for_time)
03852 continue
03853
03854
03855 time.sleep(sleep_act_time)
03856 bret = diff_file()
03857
03858
03859 fout = open(g_test_result_file, 'a')
03860 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03861
03862 if bret == True:
03863
03864 message = message + g_test_ok
03865 print message
03866 fout.write(message + '\n')
03867 else:
03868
03869 message = message + g_test_ng
03870 print message
03871 message = message + g_test_ng_message
03872 fout.write(message + '\n')
03873
03874 fin2 = open(g_diff_recv_file, 'r')
03875 while(1):
03876 s2 = fin2.readline()
03877 if len(s2) == 0:
03878 break
03879 fout.write(s2)
03880 fin2.close()
03881 fout.close()
03882
03883 time.sleep(sleep_for_time)
03884
03885
03886 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03887 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03888 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03889
03890
03891
03892
03893 case_no = case_no + 1
03894 fout = open(g_test_result_file, 'a')
03895 message = g_mess_header + g_test_case + str(case_no) + " "
03896 message = message + "Connecting(in->out, periodic,NEW), Activate -> send/recv -> Deactivate"
03897 message = message + g_mess_footer
03898 fout.write(message + '\n')
03899 fout.close()
03900 print message
03901
03902
03903 make_connecter_profile("periodic", "NEW", 1)
03904
03905
03906
03907 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03908
03909
03910 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03911
03912
03913 ret2 = g_out_ports[g_port3].connect(g_conprof3)
03914
03915 for i in range(loop_count):
03916
03917
03918 delete_recv_file()
03919
03920
03921 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
03922 time.sleep(sleep_recv_act_time)
03923 ec_send[0].activate_component(g_compo_send.rtc_ref)
03924
03925 time.sleep(sleep_act_time)
03926
03927
03928 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
03929 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
03930
03931
03932 if os.path.isfile(g_diff_recv_file) == False:
03933 fout = open(g_test_result_file, 'a')
03934 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03935 message = message + g_check_message
03936 fout.write(message + '\n')
03937 fout.close()
03938 print message
03939 time.sleep(sleep_for_time)
03940 continue
03941
03942
03943 time.sleep(sleep_act_time)
03944 bret = diff_file()
03945
03946
03947 fout = open(g_test_result_file, 'a')
03948 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
03949
03950 if bret == True:
03951
03952 message = message + g_test_ok
03953 print message
03954 fout.write(message + '\n')
03955 else:
03956
03957 message = message + g_test_ng
03958 print message
03959 message = message + g_test_ng_message
03960 fout.write(message + '\n')
03961
03962 fin2 = open(g_diff_recv_file, 'r')
03963 while(1):
03964 s2 = fin2.readline()
03965 if len(s2) == 0:
03966 break
03967 fout.write(s2)
03968 fin2.close()
03969 fout.close()
03970
03971 time.sleep(sleep_for_time)
03972
03973
03974 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
03975 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
03976 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
03977
03978
03979
03980
03981 case_no = case_no + 1
03982 fout = open(g_test_result_file, 'a')
03983 message = g_mess_header + g_test_case + str(case_no) + " "
03984 message = message + "Connecting(in->out, periodic,SKIP), Activate -> send/recv -> Deactivate"
03985 message = message + g_mess_footer
03986 fout.write(message + '\n')
03987 fout.close()
03988 print message
03989
03990
03991 make_connecter_profile("periodic", "SKIP", 1)
03992
03993
03994
03995 ret0 = g_out_ports[g_port1].connect(g_conprof1)
03996
03997
03998 ret1 = g_out_ports[g_port2].connect(g_conprof2)
03999
04000
04001 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04002
04003 for i in range(loop_count):
04004
04005
04006 delete_recv_file()
04007
04008
04009 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04010 time.sleep(sleep_recv_act_time)
04011 ec_send[0].activate_component(g_compo_send.rtc_ref)
04012
04013 time.sleep(sleep_act_time)
04014
04015
04016 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04017 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04018
04019
04020 if os.path.isfile(g_diff_recv_file) == False:
04021 fout = open(g_test_result_file, 'a')
04022 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04023 message = message + g_check_message
04024 fout.write(message + '\n')
04025 fout.close()
04026 print message
04027 time.sleep(sleep_for_time)
04028 continue
04029
04030
04031 time.sleep(sleep_act_time)
04032 bret = diff_file()
04033
04034
04035 fout = open(g_test_result_file, 'a')
04036 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04037
04038 if bret == True:
04039
04040 message = message + g_test_ok
04041 print message
04042 fout.write(message + '\n')
04043 else:
04044
04045 message = message + g_test_ng
04046 print message
04047 message = message + g_test_ng_message
04048 fout.write(message + '\n')
04049
04050 fin2 = open(g_diff_recv_file, 'r')
04051 while(1):
04052 s2 = fin2.readline()
04053 if len(s2) == 0:
04054 break
04055 fout.write(s2)
04056 fin2.close()
04057 fout.close()
04058
04059 time.sleep(sleep_for_time)
04060
04061
04062 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04063 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04064 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04065
04066
04067
04068
04069 case_no = case_no + 1
04070 fout = open(g_test_result_file, 'a')
04071 message = g_mess_header + g_test_case + str(case_no) + " "
04072 message = message + "Connect(out->in, periodic,ALL) -> Activate -> send/recv -> Deactivate -> Disconnect"
04073 message = message + g_mess_footer
04074 fout.write(message + '\n')
04075 fout.close()
04076 print message
04077
04078 for i in range(loop_count):
04079
04080
04081 delete_recv_file()
04082
04083
04084 make_connecter_profile("periodic", "ALL", 0)
04085
04086
04087
04088 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04089
04090
04091 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04092
04093
04094 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04095
04096
04097 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04098 time.sleep(sleep_recv_act_time)
04099 ec_send[0].activate_component(g_compo_send.rtc_ref)
04100
04101 time.sleep(sleep_act_time)
04102
04103
04104 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04105 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04106
04107
04108 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04109 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04110 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04111
04112
04113 if os.path.isfile(g_diff_recv_file) == False:
04114 fout = open(g_test_result_file, 'a')
04115 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04116 message = message + g_check_message
04117 fout.write(message + '\n')
04118 fout.close()
04119 print message
04120 time.sleep(sleep_for_time)
04121 continue
04122
04123
04124 time.sleep(sleep_act_time)
04125 bret = diff_file()
04126
04127
04128 fout = open(g_test_result_file, 'a')
04129 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04130
04131 if bret == True:
04132
04133 message = message + g_test_ok
04134 print message
04135 fout.write(message + '\n')
04136 else:
04137
04138 message = message + g_test_ng
04139 print message
04140 message = message + g_test_ng_message
04141 fout.write(message + '\n')
04142
04143 fin2 = open(g_diff_recv_file, 'r')
04144 while(1):
04145 s2 = fin2.readline()
04146 if len(s2) == 0:
04147 break
04148 fout.write(s2)
04149 fin2.close()
04150 fout.close()
04151
04152 time.sleep(sleep_for_time)
04153
04154
04155
04156
04157 case_no = case_no + 1
04158 fout = open(g_test_result_file, 'a')
04159 message = g_mess_header + g_test_case + str(case_no) + " "
04160 message = message + "Connect(out->in, periodic,FIFO) -> Activate -> send/recv -> Deactivate -> Disconnect"
04161 message = message + g_mess_footer
04162 fout.write(message + '\n')
04163 fout.close()
04164 print message
04165
04166 for i in range(loop_count):
04167
04168
04169 delete_recv_file()
04170
04171
04172 make_connecter_profile("periodic", "FIFO", 0)
04173
04174
04175
04176 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04177
04178
04179 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04180
04181
04182 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04183
04184
04185 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04186 time.sleep(sleep_recv_act_time)
04187 ec_send[0].activate_component(g_compo_send.rtc_ref)
04188
04189 time.sleep(sleep_act_time)
04190
04191
04192 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04193 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04194
04195
04196 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04197 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04198 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04199
04200
04201 if os.path.isfile(g_diff_recv_file) == False:
04202 fout = open(g_test_result_file, 'a')
04203 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04204 message = message + g_check_message
04205 fout.write(message + '\n')
04206 fout.close()
04207 print message
04208 time.sleep(sleep_for_time)
04209 continue
04210
04211
04212 time.sleep(sleep_act_time)
04213 bret = diff_file()
04214
04215
04216 fout = open(g_test_result_file, 'a')
04217 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04218
04219 if bret == True:
04220
04221 message = message + g_test_ok
04222 print message
04223 fout.write(message + '\n')
04224 else:
04225
04226 message = message + g_test_ng
04227 print message
04228 message = message + g_test_ng_message
04229 fout.write(message + '\n')
04230
04231 fin2 = open(g_diff_recv_file, 'r')
04232 while(1):
04233 s2 = fin2.readline()
04234 if len(s2) == 0:
04235 break
04236 fout.write(s2)
04237 fin2.close()
04238 fout.close()
04239
04240 time.sleep(sleep_for_time)
04241
04242
04243
04244
04245 case_no = case_no + 1
04246 fout = open(g_test_result_file, 'a')
04247 message = g_mess_header + g_test_case + str(case_no) + " "
04248 message = message + "Connect(out->in, periodic,NEW) -> Activate -> send/recv -> Deactivate -> Disconnect"
04249 message = message + g_mess_footer
04250 fout.write(message + '\n')
04251 fout.close()
04252 print message
04253
04254 for i in range(loop_count):
04255
04256
04257 delete_recv_file()
04258
04259
04260 make_connecter_profile("periodic", "NEW", 0)
04261
04262
04263
04264 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04265
04266
04267 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04268
04269
04270 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04271
04272
04273 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04274 time.sleep(sleep_recv_act_time)
04275 ec_send[0].activate_component(g_compo_send.rtc_ref)
04276
04277 time.sleep(sleep_act_time)
04278
04279
04280 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04281 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04282
04283
04284 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04285 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04286 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04287
04288
04289 if os.path.isfile(g_diff_recv_file) == False:
04290 fout = open(g_test_result_file, 'a')
04291 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04292 message = message + g_check_message
04293 fout.write(message + '\n')
04294 fout.close()
04295 print message
04296 time.sleep(sleep_for_time)
04297 continue
04298
04299
04300 time.sleep(sleep_act_time)
04301 bret = diff_file()
04302
04303
04304 fout = open(g_test_result_file, 'a')
04305 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04306
04307 if bret == True:
04308
04309 message = message + g_test_ok
04310 print message
04311 fout.write(message + '\n')
04312 else:
04313
04314 message = message + g_test_ng
04315 print message
04316 message = message + g_test_ng_message
04317 fout.write(message + '\n')
04318
04319 fin2 = open(g_diff_recv_file, 'r')
04320 while(1):
04321 s2 = fin2.readline()
04322 if len(s2) == 0:
04323 break
04324 fout.write(s2)
04325 fin2.close()
04326 fout.close()
04327
04328 time.sleep(sleep_for_time)
04329
04330
04331
04332
04333 case_no = case_no + 1
04334 fout = open(g_test_result_file, 'a')
04335 message = g_mess_header + g_test_case + str(case_no) + " "
04336 message = message + "Connect(out->in, periodic,SKIP) -> Activate -> send/recv -> Deactivate -> Disconnect"
04337 message = message + g_mess_footer
04338 fout.write(message + '\n')
04339 fout.close()
04340 print message
04341
04342 for i in range(loop_count):
04343
04344
04345 delete_recv_file()
04346
04347
04348 make_connecter_profile("periodic", "SKIP", 0)
04349
04350
04351
04352 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04353
04354
04355 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04356
04357
04358 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04359
04360
04361 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04362 time.sleep(sleep_recv_act_time)
04363 ec_send[0].activate_component(g_compo_send.rtc_ref)
04364
04365 time.sleep(sleep_act_time)
04366
04367
04368 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04369 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04370
04371
04372 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04373 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04374 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04375
04376
04377 if os.path.isfile(g_diff_recv_file) == False:
04378 fout = open(g_test_result_file, 'a')
04379 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04380 message = message + g_check_message
04381 fout.write(message + '\n')
04382 fout.close()
04383 print message
04384 time.sleep(sleep_for_time)
04385 continue
04386
04387
04388 time.sleep(sleep_act_time)
04389 bret = diff_file()
04390
04391
04392 fout = open(g_test_result_file, 'a')
04393 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04394
04395 if bret == True:
04396
04397 message = message + g_test_ok
04398 print message
04399 fout.write(message + '\n')
04400 else:
04401
04402 message = message + g_test_ng
04403 print message
04404 message = message + g_test_ng_message
04405 fout.write(message + '\n')
04406
04407 fin2 = open(g_diff_recv_file, 'r')
04408 while(1):
04409 s2 = fin2.readline()
04410 if len(s2) == 0:
04411 break
04412 fout.write(s2)
04413 fin2.close()
04414 fout.close()
04415
04416 time.sleep(sleep_for_time)
04417
04418
04419
04420
04421 case_no = case_no + 1
04422 fout = open(g_test_result_file, 'a')
04423 message = g_mess_header + g_test_case + str(case_no) + " "
04424 message = message + "Connect(in->out, periodic,ALL) -> Activate -> send/recv -> Deactivate -> Disconnect"
04425 message = message + g_mess_footer
04426 fout.write(message + '\n')
04427 fout.close()
04428 print message
04429
04430 for i in range(loop_count):
04431
04432
04433 delete_recv_file()
04434
04435
04436 make_connecter_profile("periodic", "ALL", 1)
04437
04438
04439
04440 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04441
04442
04443 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04444
04445
04446 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04447
04448
04449 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04450 time.sleep(sleep_recv_act_time)
04451 ec_send[0].activate_component(g_compo_send.rtc_ref)
04452
04453 time.sleep(sleep_act_time)
04454
04455
04456 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04457 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04458
04459
04460 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04461 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04462 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04463
04464
04465 if os.path.isfile(g_diff_recv_file) == False:
04466 fout = open(g_test_result_file, 'a')
04467 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04468 message = message + g_check_message
04469 fout.write(message + '\n')
04470 fout.close()
04471 print message
04472 time.sleep(sleep_for_time)
04473 continue
04474
04475
04476 time.sleep(sleep_act_time)
04477 bret = diff_file()
04478
04479
04480 fout = open(g_test_result_file, 'a')
04481 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04482
04483 if bret == True:
04484
04485 message = message + g_test_ok
04486 print message
04487 fout.write(message + '\n')
04488 else:
04489
04490 message = message + g_test_ng
04491 print message
04492 message = message + g_test_ng_message
04493 fout.write(message + '\n')
04494
04495 fin2 = open(g_diff_recv_file, 'r')
04496 while(1):
04497 s2 = fin2.readline()
04498 if len(s2) == 0:
04499 break
04500 fout.write(s2)
04501 fin2.close()
04502 fout.close()
04503
04504 time.sleep(sleep_for_time)
04505
04506
04507
04508
04509 case_no = case_no + 1
04510 fout = open(g_test_result_file, 'a')
04511 message = g_mess_header + g_test_case + str(case_no) + " "
04512 message = message + "Connect(in->out, periodic,FIFO) -> Activate -> send/recv -> Deactivate -> Disconnect"
04513 message = message + g_mess_footer
04514 fout.write(message + '\n')
04515 fout.close()
04516 print message
04517
04518 for i in range(loop_count):
04519
04520
04521 delete_recv_file()
04522
04523
04524 make_connecter_profile("periodic", "FIFO", 1)
04525
04526
04527
04528 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04529
04530
04531 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04532
04533
04534 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04535
04536
04537 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04538 time.sleep(sleep_recv_act_time)
04539 ec_send[0].activate_component(g_compo_send.rtc_ref)
04540
04541 time.sleep(sleep_act_time)
04542
04543
04544 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04545 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04546
04547
04548 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04549 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04550 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04551
04552
04553 if os.path.isfile(g_diff_recv_file) == False:
04554 fout = open(g_test_result_file, 'a')
04555 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04556 message = message + g_check_message
04557 fout.write(message + '\n')
04558 fout.close()
04559 print message
04560 time.sleep(sleep_for_time)
04561 continue
04562
04563
04564 time.sleep(sleep_act_time)
04565 bret = diff_file()
04566
04567
04568 fout = open(g_test_result_file, 'a')
04569 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04570
04571 if bret == True:
04572
04573 message = message + g_test_ok
04574 print message
04575 fout.write(message + '\n')
04576 else:
04577
04578 message = message + g_test_ng
04579 print message
04580 message = message + g_test_ng_message
04581 fout.write(message + '\n')
04582
04583 fin2 = open(g_diff_recv_file, 'r')
04584 while(1):
04585 s2 = fin2.readline()
04586 if len(s2) == 0:
04587 break
04588 fout.write(s2)
04589 fin2.close()
04590 fout.close()
04591
04592 time.sleep(sleep_for_time)
04593
04594
04595
04596
04597 case_no = case_no + 1
04598 fout = open(g_test_result_file, 'a')
04599 message = g_mess_header + g_test_case + str(case_no) + " "
04600 message = message + "Connect(in->out, periodic,NEW) -> Activate -> send/recv -> Deactivate -> Disconnect"
04601 message = message + g_mess_footer
04602 fout.write(message + '\n')
04603 fout.close()
04604 print message
04605
04606 for i in range(loop_count):
04607
04608
04609 delete_recv_file()
04610
04611
04612 make_connecter_profile("periodic", "NEW", 1)
04613
04614
04615
04616 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04617
04618
04619 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04620
04621
04622 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04623
04624
04625 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04626 time.sleep(sleep_recv_act_time)
04627 ec_send[0].activate_component(g_compo_send.rtc_ref)
04628
04629 time.sleep(sleep_act_time)
04630
04631
04632 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04633 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04634
04635
04636 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04637 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04638 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04639
04640
04641 if os.path.isfile(g_diff_recv_file) == False:
04642 fout = open(g_test_result_file, 'a')
04643 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04644 message = message + g_check_message
04645 fout.write(message + '\n')
04646 fout.close()
04647 print message
04648 time.sleep(sleep_for_time)
04649 continue
04650
04651
04652 time.sleep(sleep_act_time)
04653 bret = diff_file()
04654
04655
04656 fout = open(g_test_result_file, 'a')
04657 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04658
04659 if bret == True:
04660
04661 message = message + g_test_ok
04662 print message
04663 fout.write(message + '\n')
04664 else:
04665
04666 message = message + g_test_ng
04667 print message
04668 message = message + g_test_ng_message
04669 fout.write(message + '\n')
04670
04671 fin2 = open(g_diff_recv_file, 'r')
04672 while(1):
04673 s2 = fin2.readline()
04674 if len(s2) == 0:
04675 break
04676 fout.write(s2)
04677 fin2.close()
04678 fout.close()
04679
04680 time.sleep(sleep_for_time)
04681
04682
04683
04684
04685 case_no = case_no + 1
04686 fout = open(g_test_result_file, 'a')
04687 message = g_mess_header + g_test_case + str(case_no) + " "
04688 message = message + "Connect(in->out, periodic,SKIP) -> Activate -> send/recv -> Deactivate -> Disconnect"
04689 message = message + g_mess_footer
04690 fout.write(message + '\n')
04691 fout.close()
04692 print message
04693
04694 for i in range(loop_count):
04695
04696
04697 delete_recv_file()
04698
04699
04700 make_connecter_profile("periodic", "SKIP", 1)
04701
04702
04703
04704 ret0 = g_out_ports[g_port1].connect(g_conprof1)
04705
04706
04707 ret1 = g_out_ports[g_port2].connect(g_conprof2)
04708
04709
04710 ret2 = g_out_ports[g_port3].connect(g_conprof3)
04711
04712
04713 ec_recv[0].activate_component(g_compo_recv.rtc_ref)
04714 time.sleep(sleep_recv_act_time)
04715 ec_send[0].activate_component(g_compo_send.rtc_ref)
04716
04717 time.sleep(sleep_act_time)
04718
04719
04720 ec_send[0].deactivate_component(g_compo_send.rtc_ref)
04721 ec_recv[0].deactivate_component(g_compo_recv.rtc_ref)
04722
04723
04724 g_in_ports[g_port3].disconnect(g_conprof3.connector_id)
04725 g_in_ports[g_port2].disconnect(g_conprof2.connector_id)
04726 g_in_ports[g_port1].disconnect(g_conprof1.connector_id)
04727
04728
04729 if os.path.isfile(g_diff_recv_file) == False:
04730 fout = open(g_test_result_file, 'a')
04731 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04732 message = message + g_check_message
04733 fout.write(message + '\n')
04734 fout.close()
04735 print message
04736 time.sleep(sleep_for_time)
04737 continue
04738
04739
04740 time.sleep(sleep_act_time)
04741 bret = diff_file()
04742
04743
04744 fout = open(g_test_result_file, 'a')
04745 message = g_mess_header + g_test_case + str(case_no) + " " + g_test_cnt + str(i+1) + g_mess_footer
04746
04747 if bret == True:
04748
04749 message = message + g_test_ok
04750 print message
04751 fout.write(message + '\n')
04752 else:
04753
04754 message = message + g_test_ng
04755 print message
04756 message = message + g_test_ng_message
04757 fout.write(message + '\n')
04758
04759 fin2 = open(g_diff_recv_file, 'r')
04760 while(1):
04761 s2 = fin2.readline()
04762 if len(s2) == 0:
04763 break
04764 fout.write(s2)
04765 fin2.close()
04766 fout.close()
04767
04768 time.sleep(sleep_for_time)
04769
04770 print "Test Complete."