Skip to content

Conversation

@vvejell1
Copy link
Contributor

@vvejell1 vvejell1 commented Dec 14, 2022

Signed-off-by: Vaishnavi Vejella [email protected]

Issue:
While trying to perform ARM integration test against firecracker-go-sdk, found that SendCtrlAltDel is not supported on aarch64 and TestNetworkMachineCNIWithConfFile test is failing because testPing is not supported when we are running the test on multiple VM's.

Description of changes:
If the architecture is ARM64, we are not able to send SendCtrlAltDel (API) on aarch64, so stopping the machine using StopVMM() and also skipping the test by not passing the VM's then TestNetworkMachineCNIWithConfFile will get passed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vvejell1 vvejell1 requested a review from a team as a code owner December 14, 2022 19:44
network_test.go Outdated
fctesting.RequiresRoot(t)

cniBinPath := []string{"/opt/cni/bin", testDataBin}
cniBinPath := []string{"/testdata/bin", testDataBin}
Copy link
Contributor

@ginglis13 ginglis13 Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cniBinPath := []string{"/testdata/bin", testDataBin}
cniBinPath := []string{testDataBin, "/opt/cni/bin"}

testDataBin is defined here and should provide the path to these CNI plugins built:

testDataBin = filepath.Join(testDataPath, "bin")

I don't think we can guarantee "/testdata" exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously CNI plugins are set towards /opt/cni/bin which consists of binaries in X86 format. But when we require the ARM related binaries and they exists in testdata/bin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should put the testdata binaries on PATH before "/opt/cni/bin"; testDataBin gives us a reference to the path to testdata binaries. "/testdata/bin" is not guranteed to exist on all setups so we should use the testDataBin variable

testDataPath = envOrDefault(testDataPathEnv, "./testdata")
testDataLogPath = filepath.Join(testDataPath, "logs")
testDataBin = filepath.Join(testDataPath, "bin")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the variable to testDataBin

network_test.go Outdated
assert.FileExists(t, expectedCacheDirPath, "CNI cache dir doesn't exist after vm startup")

testPing(t, vmIP, 3, 5*time.Second)
if runtime.GOARCH != "arm64" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth checking for arm as well?

https://pkg.go.dev/internal/goarch#GOARCH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried by printing runtime.GOARCH to check if the arch is ARM64

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike sending Ctrl + Alt + Del, networking should work on aarch64. Do you know the root cause?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestPing() is giving internet gateway error such as "Destination Host Unreachable" and not able to ping multiple VM's at a time.

@vvejell1 vvejell1 force-pushed the arm branch 3 times, most recently from dd86cd6 to 6d2bbf6 Compare December 14, 2022 21:11
commands:
- "sudo -E PATH=$PATH FC_TEST_DATA_PATH=${FC_TEST_DATA_PATH} make -C examples/cmd/snapshotting run"
- "sudo -E PATH=$PATH FC_TEST_DATA_PATH=${FC_TEST_DATA_PATH} make -C examples/cmd/snapshotting clean"
- "sudo -E PATH=$FC_TEST_DATA_PATH:$PATH FC_TEST_DATA_PATH=${FC_TEST_DATA_PATH} make -C examples/cmd/snapshotting run"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get Arm version binaries like Jailer and Firecracker which are located in TEST_DATA_PATH and added it to PATH

network_test.go Outdated
assert.FileExists(t, expectedCacheDirPath, "CNI cache dir doesn't exist after vm startup")

testPing(t, vmIP, 3, 5*time.Second)
if runtime.GOARCH != "arm64" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike sending Ctrl + Alt + Del, networking should work on aarch64. Do you know the root cause?

@kzys
Copy link

kzys commented Dec 14, 2022

Your PR description is good. Please put some of that in the commit message itself.

@vvejell1 vvejell1 force-pushed the arm branch 13 times, most recently from 68e22ab to b985524 Compare December 19, 2022 18:40
network_test.go Outdated

numVMs := 10
vmIPs := make(chan string, numVMs)
if runtime.GOARCH != "arm64" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Let's use t.Skip instead
  • If possible, we should skip this test entirely. It doesn't make much sense to setup the VM, if we don't run any validations against the VM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, let me try in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After using t.skip() here, TestMicroVMExecution test got failed in the BuildKite because we are skipping and not allowing the VM's to perform the test.
https://buildkite.com/firecracker-microvm/vvejella-firecracker-go-sdk-arm/builds/27#01852ca2-9f4c-41aa-b2a4-0d6e834c6399:~:text=FAIL%3A-,TestMicroVMExecution,-(30.03s)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they are related. The VM here and TestMicroVMExecution's VM are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it is causing flaky test and now I test is fine

network_test.go Outdated
numVMs := 10
vmIPs := make(chan string, numVMs)
if runtime.GOARCH == "arm64" {
t.Skip()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the skip by replacing it with return without nesting the lines below.

@vvejell1 vvejell1 force-pushed the arm branch 2 times, most recently from d8ae7a5 to 2778a98 Compare December 20, 2022 18:25
Copy link
Contributor

@ginglis13 ginglis13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vvejell1 vvejell1 force-pushed the arm branch 3 times, most recently from eb0e9db to 1516929 Compare December 22, 2022 22:00
- If arch is ARM, SendCtrlAltDel is not supported and Skip testPing

Signed-off-by: Vaishnavi Vejella <[email protected]>
@vvejell1 vvejell1 merged commit 8f0df49 into firecracker-microvm:main Dec 22, 2022
vvejell1 added a commit to vvejell1/firecracker-go-sdk that referenced this pull request Jan 5, 2023
Adding requirements to support ARM instance

Signed-off-by: Debian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants