diff --git a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/Ethernet_Basic_Validation.yaml b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/Ethernet_Basic_Validation.yaml index bcf98f29..cf613a2d 100644 --- a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/Ethernet_Basic_Validation.yaml +++ b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/Ethernet_Basic_Validation.yaml @@ -11,7 +11,7 @@ params: LINK_TIMEOUT_S: "10" IP_TIMEOUT_S: "15" ETH_INTERFACE: "" - PING_TARGET: "" + PING_TARGET: "" # Empty uses the runner default of 8.8.8.8. Set an IP to override. PING_COUNT: "4" PING_WAIT_S: "2" PING_RETRIES: "3" diff --git a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/README.md b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/README.md index 8c0c24ae..860f0f15 100644 --- a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/README.md +++ b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/README.md @@ -27,8 +27,9 @@ A disconnected port is reported as an interface-level SKIP rather than a failure - Connect the port to a link partner or switch. - Provide IPv4 using the image network manager, DHCP configuration, or a preconfigured static address. -- Ensure the selected gateway or `PING_TARGET` is reachable through the tested - interface. Internet access is not required when a local peer is used. +- The default target `8.8.8.8` must be reachable and reply to ICMP through the + tested interface. For an isolated network, select a reachable local peer with + `--ping-target` or `PING_TARGET`. Internet access is not required with a local peer. ## Files @@ -47,15 +48,17 @@ Runner/utils/lib_ethernet.sh ## Configuration -CLI options override environment variables. Run `./run.sh --help` for the -on-target option summary. +CLI options override environment variables. An omitted or empty +`--ping-target` preserves `PING_TARGET` when set, otherwise it uses `8.8.8.8`. +The default gateway is not automatically selected or used as a fallback after +ping failure. Run `./run.sh --help` for the on-target option summary. | CLI option | Environment variable | Default | Description | |---|---|---:|---| | `--link-timeout` | `LINK_TIMEOUT_S` | `10` | Maximum wait for carrier | | `--ip-timeout` | `IP_TIMEOUT_S` | `15` | Maximum wait for a valid IPv4 | | `--interface` | `ETH_INTERFACE` | automatic | Explicit interface, otherwise auto-detect | -| `--ping-target` | `PING_TARGET` | automatic | Explicit target, otherwise gateway or `8.8.8.8` | +| `--ping-target` | `PING_TARGET` | `8.8.8.8` | User-provided target overrides the public IPv4 default | | `--ping-count` | `PING_COUNT` | `4` | Packets per ping attempt | | `--ping-wait` | `PING_WAIT_S` | `2` | Per-packet ping timeout | | `--ping-retries` | `PING_RETRIES` | `3` | Ping attempts | @@ -67,12 +70,25 @@ cd Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation ./run.sh ``` -Example: +The default command pings `8.8.8.8` through each tested interface. All retries +use the same selected target. To select a local peer explicitly: ```sh ./run.sh --ping-target 192.168.1.1 --link-timeout 20 ``` +The environment equivalent and CLI precedence are: + +```sh +PING_TARGET=192.168.1.1 ./run.sh +PING_TARGET=192.168.1.1 ./run.sh --ping-target 192.168.1.2 +``` + +For LAVA, set the existing `PING_TARGET` parameter to the desired IP. Its empty +default selects `8.8.8.8`. Unreachable targets fail the connectivity check after +the configured retries, even when carrier and IPv4 checks pass. Disconnected +ports and interfaces without valid IPv4 retain their existing SKIP behavior. + To test one explicit interface, use either form: ```sh diff --git a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/run.sh b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/run.sh index dda7a944..b68df82d 100755 --- a/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/run.sh +++ b/Runner/suites/Connectivity/Ethernet/Ethernet_Basic_Validation/run.sh @@ -65,18 +65,20 @@ RESULT_TABLE="./$TESTNAME.results.tsv" LINK_TIMEOUT_S="${LINK_TIMEOUT_S:-10}" IP_TIMEOUT_S="${IP_TIMEOUT_S:-15}" ETH_INTERFACE="${ETH_INTERFACE:-}" -PING_TARGET="${PING_TARGET:-}" +PING_TARGET="${PING_TARGET:-8.8.8.8}" PING_COUNT="${PING_COUNT:-4}" PING_WAIT_S="${PING_WAIT_S:-2}" PING_RETRIES="${PING_RETRIES:-3}" +# usage +# Print supported options and the ping-target default to stdout. Returns 0. usage() { printf '%s\n' \ "Usage: ./run.sh [options]" \ " --link-timeout SECONDS" \ " --ip-timeout SECONDS" \ " --interface IFACE" \ - " --ping-target ADDRESS" \ + " --ping-target ADDRESS (default: PING_TARGET or 8.8.8.8)" \ " --ping-count COUNT" \ " --ping-wait SECONDS" \ " --ping-retries COUNT" \ @@ -84,6 +86,9 @@ usage() { "CLI options override environment variables." } +# parse_args [OPTIONS...] +# Apply CLI overrides to suite settings. Empty ping-target values preserve the +# environment/default target. No stdout except help, exits 2 on invalid options. parse_args() { while [ "$#" -gt 0 ]; do case "$1" in @@ -116,7 +121,9 @@ parse_args() { usage exit 2 } - PING_TARGET="$2" + if [ -n "$2" ]; then + PING_TARGET="$2" + fi shift 2 ;; --ping-count) @@ -164,7 +171,7 @@ rm -f "$RES_FILE" "$SUMMARY_FILE" "$RESULT_TABLE" log_info "--------------------------------------------------------------------------" log_info "------------------- Starting $TESTNAME Testcase --------------------------" -log_info "Configuration: interface=${ETH_INTERFACE:-auto} LINK_TIMEOUT_S=$LINK_TIMEOUT_S IP_TIMEOUT_S=$IP_TIMEOUT_S PING_TARGET=${PING_TARGET:-auto} PING_COUNT=$PING_COUNT PING_WAIT_S=$PING_WAIT_S PING_RETRIES=$PING_RETRIES" +log_info "Configuration: interface=${ETH_INTERFACE:-auto} LINK_TIMEOUT_S=$LINK_TIMEOUT_S IP_TIMEOUT_S=$IP_TIMEOUT_S PING_TARGET=$PING_TARGET PING_COUNT=$PING_COUNT PING_WAIT_S=$PING_WAIT_S PING_RETRIES=$PING_RETRIES" if ! CHECK_DEPS_NO_EXIT=1 check_dependencies \ ip \