diff --git a/src/helpers.sh b/src/helpers.sh index b670b9f..7fc8f94 100755 --- a/src/helpers.sh +++ b/src/helpers.sh @@ -3,7 +3,7 @@ . src/workflowHandler.sh . src/media.sh -ETHERNET_REGEX="LAN$|Lan$|Ethernet$" +ETHERNET_REGEX="LAN$|Lan$|Ethernet$|AX[0-9A-Z]+$" WIFI_REGEX="Airport$|Wi-Fi$" PRIORITY_HIGH="1" diff --git a/test.sh b/test.sh deleted file mode 100755 index f30ff4d..0000000 --- a/test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -. src/helpers.sh - -NAME="$(getPrimaryInterfaceName)" -echo $NAME - -DNSSTRING=$(getDNS "$(networksetup -getdnsservers "$NAME")") -echo $DNSSTRING diff --git a/tests/ethernetTests.bats b/tests/ethernetTests.bats index f3a3322..e120a00 100644 --- a/tests/ethernetTests.bats +++ b/tests/ethernetTests.bats @@ -15,6 +15,12 @@ load variables [ "$output" = "Thunderbolt Ethernet" ] } +@test "getEthernetName: get ax name" { + run getEthernetName "$LIST3" + [ "$status" -eq 0 ] + [ "$output" = "AX88179A" ] +} + @test "getEthernetInterface: get interface Thunderbolt" { run getEthernetInterface "$LIST" [ "$status" -eq 0 ] diff --git a/tests/variables.bash b/tests/variables.bash index 5e98443..be2d4e8 100644 --- a/tests/variables.bash +++ b/tests/variables.bash @@ -40,6 +40,22 @@ Ethernet Address: f8:06:c1:00:a3:cc VLAN Configurations ===================" +LIST3=" +Hardware Port: Wi-Fi +Device: en1 +Ethernet Address: f8:06:c1:00:a3:cc + +Hardware Port: AX88179A +Device: en3 +Ethernet Address: de:ad:be:ef:fe:ed + +Hardware Port: Ethernet Adapter (en4) +Device: en4 +Ethernet Address: de:ad:be:ef:fe:ee + +VLAN Configurations +===================" + NETINFO='DHCP Configuration IP address: 192.168.1.100 Subnet mask: 255.255.255.0