int main( int argc, char **argv ) { if (argc<2) { fprintf( stderr, "Usage: %s protocol.so\n", argv[0] ); return( 1 ); } protocol *test; test=new protocol( argv[1] ); if (!test) { fprintf( stderr, "%s: No memory.\n", argv[0] ); return( 2 ); } if (!test->isOk()) { fprintf( stderr, "%s: Unable to load %s.\n", argv[0], argv[1] ); delete test; return( 3 ); } printf( "%s loaded %s\n", argv[0], argv[1] ); echo_test( test ); delete test; server_client_test( argv[1] ); // TODO Tests return( 0 ); }
int main(int argc, char **argv) { int rc = 0; if (argc <= 1) { print_usage_and_exit(argv[0], EXIT_FAILURE, false); } parse_options(argc, argv); if (!dev_name) { dev_name = TIPC_DEFAULT_DEVNAME; } if (!test_name) { fprintf(stderr, "need a Test to run\n"); print_usage_and_exit(argv[0], EXIT_FAILURE, true); } if (strcmp(test_name, "connect") == 0) { rc = connect_test(opt_repeat); } else if (strcmp(test_name, "connect_foo") == 0) { rc = connect_foo(opt_repeat); } else if (strcmp(test_name, "burst_write") == 0) { rc = burst_write_test(opt_repeat, opt_msgburst, opt_msgsize, opt_variable); } else if (strcmp(test_name, "select") == 0) { rc = select_test(opt_repeat, opt_msgburst, opt_msgsize); } else if (strcmp(test_name, "blocked_read") == 0) { rc = blocked_read_test(opt_repeat); } else if (strcmp(test_name, "closer1") == 0) { rc = closer1_test(opt_repeat); } else if (strcmp(test_name, "closer2") == 0) { rc = closer2_test(opt_repeat); } else if (strcmp(test_name, "closer3") == 0) { rc = closer3_test(opt_repeat); } else if (strcmp(test_name, "echo") == 0) { rc = echo_test(opt_repeat, opt_msgsize, opt_variable); } else if(strcmp(test_name, "ta2ta-ipc") == 0) { rc = ta2ta_ipc_test(); } else if (strcmp(test_name, "dev-uuid") == 0) { rc = dev_uuid_test(); } else if (strcmp(test_name, "ta-access") == 0) { rc = ta_access_test(); } else if (strcmp(test_name, "writev") == 0) { rc = writev_test(opt_repeat, opt_msgsize, opt_variable); } else if (strcmp(test_name, "readv") == 0) { rc = readv_test(opt_repeat, opt_msgsize, opt_variable); } else { fprintf(stderr, "Unrecognized test name '%s'\n", test_name); print_usage_and_exit(argv[0], EXIT_FAILURE, true); } return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE; }
void net_test(cyg_addrword_t param) { cyg_serial_baud_rate_t old; cyg_ppp_options_t options; cyg_ppp_handle_t ppp_handle; CYG_TEST_INIT(); diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif old = ppp_test_set_baud( CYGNUM_SERIAL_BAUD_115200 ); ppp_test_announce( "TCP_ECHO" ); cyg_ppp_options_init( &options ); // options.debug = 1; // options.kdebugflag = 1; // options.flowctl = CYG_PPP_FLOWCTL_SOFTWARE; ppp_handle = cyg_ppp_up( CYGPKG_PPP_TEST_DEVICE, &options ); CYG_TEST_INFO( "Waiting for PPP to come up"); cyg_ppp_wait_up( ppp_handle ); echo_test(param); CYG_TEST_INFO( "Bringing PPP down"); cyg_ppp_down( ppp_handle ); CYG_TEST_INFO( "Waiting for PPP to go down"); cyg_ppp_wait_down( ppp_handle ); cyg_thread_delay( 200 ); ppp_test_set_baud( old ); ppp_test_finish(); CYG_TEST_PASS_FINISH("TCP ECHO test OK"); }
void communication_task(){ int status; rsc_info.rsc_tab = (struct resource_table *)&resources; rsc_info.size = sizeof(resources); zynqMP_r5_gic_initialize(); /* Initialize RPMSG framework */ status = remoteproc_resource_init(&rsc_info, rpmsg_channel_created, rpmsg_channel_deleted, rpmsg_read_cb ,&proc); if (status < 0) { return; } #ifdef USE_FREERTOS comm_queueset = xQueueCreateSet( 2 ); xQueueAddToSet( OpenAMPInstPtr.send_queue, comm_queueset); xQueueAddToSet( OpenAMPInstPtr.lock, comm_queueset); #else env_create_sync_lock(&OpenAMPInstPtr.lock,LOCKED); #endif env_enable_interrupt(VRING1_IPI_INTR_VECT,0,0); while (1) { #ifdef USE_FREERTOS QueueSetMemberHandle_t xActivatedMember; xActivatedMember = xQueueSelectFromSet( comm_queueset, portMAX_DELAY); if( xActivatedMember == OpenAMPInstPtr.lock ) { env_acquire_sync_lock(OpenAMPInstPtr.lock); process_communication(OpenAMPInstPtr); } if (xActivatedMember == OpenAMPInstPtr.send_queue) { xQueueReceive( OpenAMPInstPtr.send_queue, &send_data, 0 ); rpmsg_send(app_rp_chnl, send_data.data, send_data.length); } #else env_acquire_sync_lock(OpenAMPInstPtr.lock); process_communication(OpenAMPInstPtr); echo_test(); /* Wait for the result data on queue */ if(pq_qlength(OpenAMPInstPtr.send_queue) > 0) { send_data = pq_dequeue(OpenAMPInstPtr.send_queue); /* Send the result of echo_test back to master. */ rpmsg_send(app_rp_chnl, send_data->data, send_data->length); } #endif } }
void net_test(cyg_addrword_t param) { diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); TNR_INIT(); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif echo_test(param); TNR_PRINT_ACTIVITY(); cyg_test_exit(); }
int ssl_sock_test(void) { int ret; PJ_LOG(3,("", "..get cipher list test")); ret = get_cipher_list(); if (ret != 0) return ret; PJ_LOG(3,("", "..https client test")); ret = https_client_test(30000); // Ignore test result as internet connection may not be available. //if (ret != 0) //return ret; #ifndef PJ_SYMBIAN /* On Symbian platforms, SSL socket is implemented using CSecureSocket, * and it hasn't supported server mode, so exclude the following tests, * which require SSL server, for now. */ PJ_LOG(3,("", "..echo test w/ TLSv1 and PJ_TLS_RSA_WITH_DES_CBC_SHA cipher")); ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_TLS1, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret != 0) return ret; PJ_LOG(3,("", "..echo test w/ SSLv23 and PJ_TLS_RSA_WITH_AES_256_CBC_SHA cipher")); ret = echo_test(PJ_SSL_SOCK_PROTO_SSL23, PJ_SSL_SOCK_PROTO_SSL23, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret != 0) return ret; PJ_LOG(3,("", "..echo test w/ incompatible proto")); ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_SSL3, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret == 0) return PJ_EBUG; PJ_LOG(3,("", "..echo test w/ incompatible ciphers")); ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret == 0) return PJ_EBUG; PJ_LOG(3,("", "..echo test w/ client cert required but not provided")); ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_TRUE, PJ_FALSE); if (ret == 0) return PJ_EBUG; PJ_LOG(3,("", "..echo test w/ client cert required and provided")); ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_TRUE, PJ_TRUE); if (ret != 0) return ret; PJ_LOG(3,("", "..performance test")); ret = perf_test(PJ_IOQUEUE_MAX_HANDLES/2 - 1, 0); if (ret != 0) return ret; PJ_LOG(3,("", "..client non-SSL (handshake timeout 5 secs)")); ret = client_non_ssl(5000); /* PJ_TIMEDOUT won't be returned as accepted socket is deleted silently */ if (ret != 0) return ret; #endif PJ_LOG(3,("", "..server non-SSL (handshake timeout 5 secs)")); ret = server_non_ssl(5000); if (ret != PJ_ETIMEDOUT) return ret; return 0; }
int main(int argc, char **argv) { int rc = 0; int nr_round; if (argc < 3) { usage(); goto out; } if (strcmp(argv[1], "-n") != 0) { usage(); goto out; } nr_round = atoi(argv[2]); if (nr_round == 0) { usage(); goto out; } do { rc = unit_test(nr_round); if (rc != 0) { printf("unit_test failed.\n"); } else { printf("unit_test finished with round %d.\n", nr_round); } } while (FALSE); echo_test(); mkdir_test(); ls_test(); cd_test(); cat_test(); date_test(); lsmod_test(); null_dev_test(); multi_processes_test(); clear_test(); shutdown_test(); while (TRUE) { ; } out: return rc; }
int main(int argc, char *argv[]) { echo_test(argv[1]); return 0; }
int main(int argc, char *argv[]){ DWORD status = 0; DWORD errorstatus = 0; string error_str; scu_mil myscu; /* int test = 0; BYTE blub = 0x38; cin>>hex>>test; printf("test 0x%x \n", (unsigned char)test); cout<<"HEX :"<<hex<<test<<endl; cout<<"DEC :"<<dec<<test<<endl; cout<<"BYTE HEX :"<<hex<<char(test)<<endl; cout<<"BYTE DEC :"<<dec<<BYTE(test)<<endl; //blub = test; cout<<"HEX blub: "<<hex<<blub<<endl;*/ if(argc == 1){ cout<<"No target device defined !"<<endl; cout<<"example : scumil tcp/scuxl0089.acc"<<endl; cout<<"end"<<endl; return 0; } int choice = 0; bool run = true; // generator starten srand((unsigned)time(NULL)); // status = myscu.scu_milbusopen("tcp/scuxl0089.acc", errorstatus); status = myscu.scu_milbusopen(argv[1], errorstatus); error_str = myscu.scu_milerror(status); cout <<"open scu : "<<error_str<<endl; if (status != status_ok){ return 0; } // ------------------------- do{ choice = print_menue(); switch (choice) { case 1: scan_milbus_loop(myscu); break; case 2: write_data(myscu); break; case 3: write_cmd(myscu); break; case 4: read_data(myscu); break; case 5: write_ifk(myscu); break; case 6: read_ifk(myscu); break; case 7: cout<<endl<<"IFKs online:"<<endl; cout<<"----------------"<<endl; echo_test(myscu,choose_ifk(myscu)); break; default : run = false; break; } }while (run); // ------------------------- status = myscu.scu_milbusclose(errorstatus); error_str = myscu.scu_milerror(status); cout <<"close scu : "<<error_str<<endl; return 0; }