HTTP Server Example Tests : Fix various issues

* Fixed regex constraints for parsing IP and other parameters from monitor log.
* httplib connection timeouts set
* Redundent tests (commented out earlier) have been removed from advanced_tests. These tests are already run during unit testing.
This commit is contained in:
Anurag Kar
2018-09-03 02:31:44 +05:30
parent a557e8cc14
commit 3ed5af18fd
10 changed files with 44 additions and 302 deletions

View File

@@ -56,8 +56,8 @@ def test_examples_protocol_http_server_persistence(env, extra_data):
# Parse IP address of STA
print "Waiting to connect with AP"
got_ip = dut1.expect(re.compile(r"(?:[\s\S]*)Got IP: (\d+.\d+.\d+.\d+)"), timeout=120)[0]
got_port = dut1.expect(re.compile(r"(?:[\s\S]*)Starting server on port: (\d+)"), timeout=30)[0]
got_ip = dut1.expect(re.compile(r"(?:[\s\S]*)Got IP: '(\d+.\d+.\d+.\d+)'"), timeout=120)[0]
got_port = dut1.expect(re.compile(r"(?:[\s\S]*)Starting server on port: '(\d+)'"), timeout=30)[0]
print "Got IP : " + got_ip
print "Got Port : " + got_port

View File

@@ -162,7 +162,7 @@ httpd_handle_t start_webserver(void)
{
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
// Start the httpd server
ESP_LOGI(TAG, "Starting server on port: %d", config.server_port);
ESP_LOGI(TAG, "Starting server on port: '%d'", config.server_port);
httpd_handle_t server;
if (httpd_start(&server, &config) == ESP_OK) {
@@ -195,7 +195,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event)
break;
case SYSTEM_EVENT_STA_GOT_IP:
ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP");
ESP_LOGI(TAG, "Got IP: %s",
ESP_LOGI(TAG, "Got IP: '%s'",
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
/* Start the web server */

View File

@@ -18,7 +18,7 @@ import httplib
import argparse
def start_session (ip, port):
return httplib.HTTPConnection(ip, int(port))
return httplib.HTTPConnection(ip, int(port), timeout=15)
def end_session (conn):
conn.close()