Skip to content

Commit

Permalink
Detect AX ethernet adapters (close #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodalgaard committed Sep 27, 2023
1 parent c2d3964 commit 0c1beda
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 0 additions & 9 deletions test.sh

This file was deleted.

6 changes: 6 additions & 0 deletions tests/ethernetTests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
16 changes: 16 additions & 0 deletions tests/variables.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c1beda

Please sign in to comment.