Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E testing using KinD #100

Merged
merged 7 commits into from
Jun 15, 2021
Merged

Conversation

martinkennelly
Copy link
Member

Add option to execute E2E tests using KinD

* Golang code to ensure VFs created during testing remain
  in test network namespace (KinD worker network namespace)

* Shell script to fetch test tools, execute E2E tests using
  KinD and teardown KinD test environment

Depends on unmerged #97

@martinkennelly martinkennelly changed the title Kind E2E testing using KinD E2E testing using KinD Apr 4, 2021
@martinkennelly martinkennelly force-pushed the kind-e2e branch 2 times, most recently from 4ea1f4e to 9290bdf Compare April 4, 2021 19:12
@vadorovsky
Copy link

I tried to test this PR (by checking out directly your branch), but unfortunately I'm getting those errors:

https://paste.opensuse.org/85826568

Any idea what I'm doing wrong? I'm running those with ./hack/test-e2e-kind-cluster.sh 0000:81:00.1 and my devices are:

# lshw -c network -businfo  
Bus info          Device     Class          Description
=======================================================
pci@0000:02:00.0  eth0       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:02:00.1  eth1       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:81:00.0  eth2       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:81:00.1  eth3       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:81:00.2  eth4       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:81:00.3  eth5       network        Ethernet Controller X710 for 10GbE SFP+
pci@0000:81:0a.0  eth13      network        Ethernet Virtual Function 700 Series
pci@0000:81:0a.1  eth12      network        Ethernet Virtual Function 700 Series
pci@0000:81:0a.2  eth11      network        Ethernet Virtual Function 700 Series
pci@0000:81:0a.3  eth10      network        Ethernet Virtual Function 700 Series

@martinkennelly
Copy link
Member Author

@mrostecki I have a feeling it is issue with KinD cluster or connectivity to the KinD cluster. Catch me on NPWG slack tomorrow and we can have a look. I sent you an email with slack contact details. I have seen this error when the test cases were unable to connect to KinD cluster so I added this command to the script:

export KUBECONFIG="${HOME}/.kube/config"

@martinkennelly
Copy link
Member Author

I am going to rework this patch to remove calling the pf network namespace setting from being called in the shell script to adding it into the test script itself. Thanks for feedback @mrostecki ! Hoping for more!

echo "## retrieving netns path from container"
netnspath="$(docker inspect --format '{{ .NetworkSettings.SandboxKey }}' "${kind_container}")"
echo "## deploying monitoring of PF/VF network namespace"
"${root}hack/pf-vf-netns-set" --pfpciaddress "${test_pf_pci_addr}" --netnspath "${netnspath}" &

Choose a reason for hiding this comment

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

I'd suggest doing it with sudo -E if the script is launched by an user.

@martinkennelly
Copy link
Member Author

@mrostecki can you retest it? See the file docs/test-kind.md

Copy link

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

@martinkennelly Thanks! New changes LGTM and they work without any additional changes

Ran 5 of 5 Specs in 531.699 seconds
SUCCESS! -- 5 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestSriovTests (531.70s)
PASS
coverage: [no statements]
ok      github.com/k8snetworkplumbingwg/sriov-network-operator/test/e2e 531.723s        coverage: [no statements]
make: Leaving directory '/home/agabus/sriov-network-operator'

@pliurh
Copy link
Collaborator

pliurh commented May 12, 2021

@martinkennelly could you rebase this PR.

If I understand it correctly, we still need a machine with an SRIOV NIC to run this test, right?

ipatrykx and others added 6 commits May 25, 2021 11:40
* Golang code to ensure VFs created during testing remain
  in test network namespace (KinD worker network namespace)

* Shell script to fetch test tools, execute E2E tests using
  KinD and teardown KinD test environment

Signed-off-by: Kennelly, Martin <martin.kennelly@intel.com>
Signed-off-by: Patryk Strusiewicz-Surmacki <patrykx.strusiewicz-surmacki@intel.com>
Move PF/VF netns monitoring to test script to prevent
escape processes during testing.

Add logging to PF/VF monitoring. Increase in test log level
required to view its output.

PF/VF monitor does not exist when PF not found, assumes it is
in correct netns and continues.

Rename execution of KinD cluster and testing file to be
consistent with existing files.

Move e2e doc to docs.

Signed-off-by: Kennelly, Martin <martin.kennelly@intel.com>
Signed-off-by: Martin Kennelly <martin.kennelly@intel.com>
Signed-off-by: Kennelly, Martin <martin.kennelly@intel.com>
Signed-off-by: Martin Kennelly <martin.kennelly@intel.com>
Signed-off-by: Martin Kennelly <martin.kennelly@intel.com>
@martinkennelly
Copy link
Member Author

martinkennelly commented May 25, 2021

@pliurh Done. I made one change following rebase captured in the head commit f116730 to disable the webhooks explicitly when testing E2E - a change enabled webhooks by default now. I think they should be enabled when we have sufficient tests for them.

we still need a machine with an SRIOV NIC to run this test, right?

Yes. You need to know the PCI address of a PF.

Signed-off-by: Martin Kennelly <martin.kennelly@intel.com>
@pliurh pliurh merged commit bb85ac9 into k8snetworkplumbingwg:master Jun 15, 2021
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.

4 participants