mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-19 05:22:21 +02:00
ci/mdsn: Fix example test on ethernet runners
* Ethernet kit uses GPIO0 for ref-clock, so the test button hits constantly * Add a freeRTOS delay when checking result on assync queries * Original commit: espressif/esp-idf@afe7ab3b2c
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
94ae672041
commit
7f42c31252
@ -1,5 +1,12 @@
|
|||||||
menu "Example Configuration"
|
menu "Example Configuration"
|
||||||
|
|
||||||
|
config MDNS_GPIO_RANGE_MAX
|
||||||
|
int
|
||||||
|
default 33 if IDF_TARGET_ESP32
|
||||||
|
default 46 if IDF_TARGET_ESP32S2
|
||||||
|
default 19 if IDF_TARGET_ESP32C3
|
||||||
|
default 48 if IDF_TARGET_ESP32S3
|
||||||
|
|
||||||
config MDNS_HOSTNAME
|
config MDNS_HOSTNAME
|
||||||
string "mDNS Hostname"
|
string "mDNS Hostname"
|
||||||
default "esp32-mdns"
|
default "esp32-mdns"
|
||||||
@ -34,4 +41,11 @@ menu "Example Configuration"
|
|||||||
If enabled, a portion of MAC address is added to the hostname, this is used
|
If enabled, a portion of MAC address is added to the hostname, this is used
|
||||||
for evaluation of tests in CI
|
for evaluation of tests in CI
|
||||||
|
|
||||||
|
config MDNS_BUTTON_GPIO
|
||||||
|
int "Button GPIO to trigger querries"
|
||||||
|
range 0 MDNS_GPIO_RANGE_MAX
|
||||||
|
default 0
|
||||||
|
help
|
||||||
|
Set the GPIO number used as mDNS test button
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define EXAMPLE_MDNS_INSTANCE CONFIG_MDNS_INSTANCE
|
#define EXAMPLE_MDNS_INSTANCE CONFIG_MDNS_INSTANCE
|
||||||
#define EXAMPLE_BUTTON_GPIO 0
|
#define EXAMPLE_BUTTON_GPIO CONFIG_MDNS_BUTTON_GPIO
|
||||||
|
|
||||||
static const char * TAG = "mdns-test";
|
static const char * TAG = "mdns-test";
|
||||||
static char * generate_hostname(void);
|
static char * generate_hostname(void);
|
||||||
@ -174,7 +174,6 @@ static void query_mdns_hosts_async(const char * host_name)
|
|||||||
ESP_LOGI(TAG, "Query both A and AAA: %s.local", host_name);
|
ESP_LOGI(TAG, "Query both A and AAA: %s.local", host_name);
|
||||||
|
|
||||||
mdns_search_once_t *s_a = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_A, 1000, 1, NULL);
|
mdns_search_once_t *s_a = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_A, 1000, 1, NULL);
|
||||||
mdns_query_async_delete(s_a);
|
|
||||||
mdns_search_once_t *s_aaaa = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_AAAA, 1000, 1, NULL);
|
mdns_search_once_t *s_aaaa = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_AAAA, 1000, 1, NULL);
|
||||||
while (s_a || s_aaaa) {
|
while (s_a || s_aaaa) {
|
||||||
if (s_a && check_and_print_result(s_a)) {
|
if (s_a && check_and_print_result(s_a)) {
|
||||||
@ -187,6 +186,7 @@ static void query_mdns_hosts_async(const char * host_name)
|
|||||||
mdns_query_async_delete(s_aaaa);
|
mdns_query_async_delete(s_aaaa);
|
||||||
s_aaaa = NULL;
|
s_aaaa = NULL;
|
||||||
}
|
}
|
||||||
|
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ def test_examples_protocol_mdns(env, extra_data):
|
|||||||
3. check the mdns name is accessible
|
3. check the mdns name is accessible
|
||||||
4. check DUT output if mdns advertized host is resolved
|
4. check DUT output if mdns advertized host is resolved
|
||||||
"""
|
"""
|
||||||
dut1 = env.get_dut('mdns-test', 'examples/protocols/mdns', dut_class=ttfw_idf.ESP32DUT)
|
dut1 = env.get_dut('mdns-test', 'examples/protocols/mdns', dut_class=ttfw_idf.ESP32DUT, app_config_name='eth_kit')
|
||||||
# check and log bin size
|
# check and log bin size
|
||||||
binary_file = os.path.join(dut1.app.binary_path, 'mdns_test.bin')
|
binary_file = os.path.join(dut1.app.binary_path, 'mdns_test.bin')
|
||||||
bin_size = os.path.getsize(binary_file)
|
bin_size = os.path.getsize(binary_file)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
CONFIG_IDF_TARGET="esp32"
|
||||||
CONFIG_MDNS_RESOLVE_TEST_SERVICES=y
|
CONFIG_MDNS_RESOLVE_TEST_SERVICES=y
|
||||||
CONFIG_MDNS_ADD_MAC_TO_HOSTNAME=y
|
CONFIG_MDNS_ADD_MAC_TO_HOSTNAME=y
|
||||||
CONFIG_MDNS_PUBLISH_DELEGATE_HOST=y
|
CONFIG_MDNS_PUBLISH_DELEGATE_HOST=y
|
||||||
@ -11,3 +12,4 @@ CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
|
|||||||
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
|
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
|
||||||
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
|
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
|
||||||
CONFIG_EXAMPLE_CONNECT_IPV6=y
|
CONFIG_EXAMPLE_CONNECT_IPV6=y
|
||||||
|
CONFIG_MDNS_BUTTON_GPIO=32
|
Reference in New Issue
Block a user