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

Add kind e2e #21

Merged
merged 4 commits into from
Sep 19, 2022
Merged

Add kind e2e #21

merged 4 commits into from
Sep 19, 2022

Conversation

maiqueb
Copy link
Collaborator

@maiqueb maiqueb commented Sep 19, 2022

This PR adds a kind based cluster to check the e2e functionality of the repo.

It simply runs the e2e scripts of the multus project, which for now, is more than enough for us.

Follow-up PRs will add a golang based e2e test suite to check the functionality of the project.

Fixes: #7

@maiqueb maiqueb force-pushed the add-kind-e2e branch 4 times, most recently from 6dc1ff5 to ddb6413 Compare September 19, 2022 09:35
Copy link
Member

@oshoval oshoval left a comment

Choose a reason for hiding this comment

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

Thanks

.github/workflows/e2e-container.yaml Outdated Show resolved Hide resolved
.github/workflows/e2e-container.yaml Outdated Show resolved Hide resolved
hack/e2e-kind-cluster-setup.sh Show resolved Hide resolved
hack/e2e-kind-cluster-setup.sh Outdated Show resolved Hide resolved
hack/e2e-kind-cluster-setup.sh Show resolved Hide resolved
hack/e2e-kind-cluster-setup.sh Outdated Show resolved Hide resolved
hack/e2e-kind-cluster-setup.sh Show resolved Hide resolved
Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
git checkout -- manifests/
}

trap "cleanup" EXIT
Copy link
Member

Choose a reason for hiding this comment

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

you might want to add here SIGINT as well (unless you remove the other one)

Copy link
Collaborator Author

@maiqueb maiqueb Sep 19, 2022

Choose a reason for hiding this comment

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

Why ? It still works:

sudo --preserve-env=PATH OCI_BIN=podman hack/e2e-kind-cluster-setup.sh
+ CNI_VERSION=0.4.0
+ OCI_BIN=podman
+ IMG_REGISTRY=localhost:5000/maiqueb
+ trap cleanup EXIT
+ setup_cluster
+ git clone https://github.com/k8snetworkplumbingwg/multus-cni/
Cloning into 'multus-cni'...
remote: Enumerating objects: 38696, done.
remote: Counting objects: 100% (1263/1263), done.
remote: Compressing objects: 100% (749/749), done.
remote: Total 38696 (delta 458), reused 1208 (delta 439), pack-reused 37433
Receiving objects: 100% (38696/38696), 49.67 MiB | 12.64 MiB/s, done.
Resolving deltas: 100% (17230/17230), done.
+ pushd multus-cni/e2e
/home/mduarted/github/multus-dynamic-networks-controller/multus-cni/e2e /home/mduarted/github/multus-dynamic-networks-controller
+ trap popd RETURN SIGINT
+ ./get_tools.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 6511k  100 6511k    0     0  7275k      0 --:--:-- --:--:-- --:--:-- 32.7M
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 42.9M  100 42.9M    0     0  37.6M      0  0:00:01  0:00:01 --:--:-- 37.6M
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0^C++ popd
/home/mduarted/github/multus-dynamic-networks-controller
+ cleanup
+ rm -rf multus-cni
+ git checkout -- manifests/

EDIT: If we omit the SIGINT in the inner trap (where I popd) the script fails when SIGINT is used (the SIGINT signal skips the popd and the cleanup function will fail, since it is executed from the wrong path:

sudo --preserve-env=PATH OCI_BIN=podman hack/e2e-kind-cluster-setup.sh
+ CNI_VERSION=0.4.0
+ OCI_BIN=podman
+ IMG_REGISTRY=localhost:5000/maiqueb
+ trap cleanup EXIT
+ setup_cluster
+ git clone https://github.com/k8snetworkplumbingwg/multus-cni/
Cloning into 'multus-cni'...
remote: Enumerating objects: 38696, done.
remote: Counting objects: 100% (1263/1263), done.
remote: Compressing objects: 100% (749/749), done.
remote: Total 38696 (delta 460), reused 1209 (delta 439), pack-reused 37433
Receiving objects: 100% (38696/38696), 49.71 MiB | 14.57 MiB/s, done.
Resolving deltas: 100% (17224/17224), done.
+ pushd multus-cni/e2e
/home/mduarted/github/multus-dynamic-networks-controller/multus-cni/e2e /home/mduarted/github/multus-dynamic-networks-controller
+ trap popd RETURN
+ ./get_tools.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 6511k  100 6511k    0     0  4372k      0  0:00:01  0:00:01 --:--:--  9.8M
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  9 42.9M    9 4094k    0     0  10.5M      0  0:00:04 --:--:--  0:00:04 10.4M^C++ cleanup
++ rm -rf multus-cni
++ git checkout -- manifests/
error: pathspec 'manifests/' did not match any file(s) known to git


CNI_VERSION=${CNI_VERSION:-0.4.0}
OCI_BIN=${OCI_BIN:-docker}
IMG_REGISTRY=${IMAGE_REGISTRY:-localhost:5000/maiqueb}
Copy link
Member

@oshoval oshoval Sep 19, 2022

Choose a reason for hiding this comment

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

note for a possible follow PR: maybe worth to use generic registry name instead maiqueb ?
(and then the deploy need to be changed as well of course)

beside the latest nits, conceptual lgtm, thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that'll happen if / when this repo is handed off to the k8snetworkplumbingwg.

@maiqueb maiqueb requested a review from oshoval September 19, 2022 11:13
Copy link
Member

@oshoval oshoval left a comment

Choose a reason for hiding this comment

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

Thanks

@maiqueb maiqueb merged commit c1b482f into main Sep 19, 2022
@maiqueb maiqueb deleted the add-kind-e2e branch September 19, 2022 11:50
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.

Set up e2e testing framework for containerd CRI
3 participants