Skip to content

Commit

Permalink
Fix ^ 2
Browse files Browse the repository at this point in the history
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
  • Loading branch information
aznashwan committed Nov 1, 2023
1 parent 5cfe36f commit 1d7aafc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,9 @@ jobs:
run: |
netsh advFirewall Firewall add rule name="Enable ICMP Protocal" protocol=icmpv4:8,any dir=in action=allow
- name: Get Main Runner Interface
- name: Log Runner Interfaces
shell: pwsh
run: |
# For logging purposes:
Get-NetIPAddress
# NOTE(aznashwan): Windows GitHub runners can have varying main interface names (e.g. "Ethernet 2")
$ifName = (Get-NetIPAddress -InterfaceAlias "Ethernet*" -AddressFamily IPv4)[0].InterfaceAlias
Write-Output "Selected main testing interface will be: '${ifName}'"
Write-Output "WINCNI_TESTING_GATEWAY_INTERFACE='${ifName}'" | Out-File -Append -FilePath "$env:GITHUB_ENV" -Encoding utf8
run: Get-NetIPAddress

- name: Test
env:
Expand Down
22 changes: 11 additions & 11 deletions test/utilities/connectivity_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ import (
)

const (
DefaultNetworkID = "2a79c333-0f85-4aa7-bb32-8dc76ca1fd46"
DefaultGatewayInterfaceName = "Ethernet"
GatewayInterfaceEnvVar = "WINCNI_TESTING_GATEWAY_INTERFACE"
dummyID = "12345"
defaultCniVersion = "0.2.0"
defaultName = "cbr0"
DefaultNetworkID = "2a79c333-0f85-4aa7-bb32-8dc76ca1fd46"
dummyID = "12345"
defaultCniVersion = "0.2.0"
defaultName = "cbr0"
)

func getDefaultDns() *cniTypes.DNS {
Expand Down Expand Up @@ -249,12 +247,14 @@ func CreateGatewayEp(t *testing.T, networkId string, ipAddress string, ipv6Adres
os.Setenv("vNicName", vNicName)
defer os.Unsetenv("vNicName")

gatwayInterfaceName := os.Getenv(GatewayInterfaceEnvVar)
if gatwayInterfaceName == "" {
gatwayInterfaceName = DefaultGatewayInterfaceName
foundIf, _, _, err := GetDefaultInterface(ipv6Adress != "")
if err != nil {
t.Errorf("unable to find interface %s. Testing failed", Interface)
return nil
}
vEthernetName := fmt.Sprintf(`"vEthernet (%s)"`, strings.Trim(gatwayInterfaceName, `"'`))
t.Logf("Setting up gateway endpoint %q on interface: %q", vNicName, vEthernetName)

vEthernetName := fmt.Sprintf(`"vEthernet (%s)"`, foundIf.Name)
t.Logf("Setting up gateway endpoint %s on interface: %s", vNicName, vEthernetName)

os.Setenv("vEthernet", vEthernetName)
defer os.Unsetenv("vEthernet")
Expand Down

0 comments on commit 1d7aafc

Please sign in to comment.