Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/external_agent_cci/wlan_ext_emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,41 +818,48 @@ void *wlan_ext_emu_t::http_server_handler(void *arg)
/*get*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_capability(req, res);
ext_emu->leave_namespace();
});

svr.Get("/Status", [&](const Request &req, Response &res) {
/*get*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_status(req, res);
ext_emu->leave_namespace();
});

svr.Get("/Results/(.+)", [&](const Request &req, Response &res) {
/*get*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_results(req, res);
ext_emu->leave_namespace();
});

svr.Post("/Command", [&](const Request &req, Response &res) {
/*post*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_command(req, res);
ext_emu->leave_namespace();
});

svr.Post("/Reffiles/(.+)", [&](const Request &req, Response &res) {
/*post*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_reffiles(req, res);
ext_emu->leave_namespace();
});

svr.Post("/Testconfig/(.+)", [&](const Request &req, Response &res) {
/*post*/
ext_emu->enter_namespace("/var/run/netns/default");
ext_emu->agent_endpoint_testconfig(req, res);
ext_emu->leave_namespace();
});

// switch_to_namespace("/var/run/netns/ots", &original_ns_fd);
ext_emu->enter_namespace("/var/run/netns/ots");
svr.listen("0.0.0.0", 1234);
ext_emu->leave_namespace();
return NULL;
}

Expand Down
2 changes: 0 additions & 2 deletions src/external_agent_cci/wlan_ext_emu_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ void *wlan_ext_emu_tests_t::test_function(void *arg)
temp_step = test->get_ext_step_from_index(step_count);
if (temp_step == NULL) {
ext_emu->ext_emu_send_signal_fail();
test->test_stop();
pthread_mutex_unlock(&test->m_lock);
pthread_exit(NULL);
return NULL;
Expand Down Expand Up @@ -316,7 +315,6 @@ void *wlan_ext_emu_tests_t::test_function(void *arg)
__LINE__, steps_status_json_str_src);
cJSON_free(steps_status_json_str_src);
ext_emu->ext_emu_send_signal_fail();
test->test_stop();
cJSON_free(agent_status);
pthread_mutex_unlock(&test->m_lock);
pthread_exit(NULL);
Expand Down
16 changes: 16 additions & 0 deletions src/sta/wlan_emu_ext_sta_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ int wlan_emu_ext_sta_mgr_t::add_eth_lan_device(test_step_params_t *step,
if (ext_agent->get_external_agent_test_status(status, step->m_ui_mgr->cci_error_code) != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: Failed to get external agent status\n",
__func__, __LINE__);
if (ext_agent->send_external_agent_stop_command() != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: failed to send external agent stop command\n", __func__, __LINE__);
}
return RETURN_ERR;
}

Expand All @@ -210,12 +214,20 @@ int wlan_emu_ext_sta_mgr_t::add_eth_lan_device(test_step_params_t *step,
step->m_ui_mgr->cci_error_code = EFOPEN;
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: fopen failed for %s\n", __func__, __LINE__,
eth_connect_info);
if (ext_agent->send_external_agent_stop_command() != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: failed to send external agent stop command\n", __func__, __LINE__);
}
return RETURN_ERR;
}
if (fwrite(cli_subdoc.c_str(), cli_subdoc.length(), 1, fp) != 1) {
step->m_ui_mgr->cci_error_code = EFWRITE;
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: fwrite failed\n", __func__, __LINE__);
fclose(fp);
if (ext_agent->send_external_agent_stop_command() != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: failed to send external agent stop command\n", __func__, __LINE__);
}
return RETURN_ERR;
}
fclose(fp);
Expand All @@ -225,6 +237,10 @@ int wlan_emu_ext_sta_mgr_t::add_eth_lan_device(test_step_params_t *step,
if (status_code != http_status_code_ok) {
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: http_post_file failed : %d\n", __func__,
__LINE__, status_code);
if (ext_agent->send_external_agent_stop_command() != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: failed to send external agent stop command\n", __func__, __LINE__);
}
return RETURN_ERR;
}

Expand Down
4 changes: 4 additions & 0 deletions src/tests/wlan_emu_test_param_eth_lan_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ int test_step_param_eth_lan_client::step_timeout()
wlan_emu_print(wlan_emu_log_level_err, "%s:%d: external agent state failed for %d\n",
__func__, __LINE__, step->step_number);
step->test_state = wlan_emu_tests_state_cmd_abort;
if (ext_agent->send_external_agent_stop_command() != RETURN_OK) {
wlan_emu_print(wlan_emu_log_level_err,
"%s:%d: failed to send external agent stop command\n", __func__, __LINE__);
}
return RETURN_ERR;
}

Expand Down
Loading