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