1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00
Commit graph

21 commits

Author SHA1 Message Date
Markus Lehtonen
bb1e4c60fb nfd-master: use namespaced label and annotation names internally
For historical reasons the labels in the default nfd namespace have been
internally represented without the namespace part. I.e. instead of
"feature.node.kubernetes.io/foo" we just use "foo". NFD worker uses this
representation, too, both internally and over the gRPC requests. The
same scheme has been used for annotations.

This patch changes NFD master to use fully namespaced label and
annotation names internally. This hopefully makes the code a bit more
understandable. It also addresses some corner cases making the handling
of label names consistent, making it possible to use both "truncated"
and fully namespaced names over the gRPC interface (and in the
annotations).
2020-11-24 12:45:06 +02:00
Markus Lehtonen
0512b06027 test/e2e: fix e2e-config node matching
Pick the correct rule when multiple node rules are present.
2020-11-24 11:35:35 +02:00
Carlos Eduardo Arango Gutierrez
f18884d6fb
Fix a thing or two under test
This patch fix typo in a file name
Updates default image on e2e tests
Adds an extra file that should be ignored to gitignore

Use master instead of versioned tag for default test image
2020-11-20 09:22:29 -05:00
Kubernetes Prow Robot
e850dfce5e
Merge pull request #340 from marquiz/devel/e2e
test/e2e: interpret node names in config as regexps
2020-11-19 13:32:51 -08:00
Markus Lehtonen
0d47a04e3e test/data: update test certs
Make them use SAN (Subject Alternative Name) instead of CN (Common Name)
field. Makes them compatible with golang 1.15 TLS.
2020-11-18 15:54:20 +02:00
Artyom Lukianov
f363ba0e92 Update e2e test to work with updated dependencies
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2020-11-18 13:09:13 +02:00
Markus Lehtonen
87c412c48e test/e2e: interpret node names in config as regexps
Interpret node names in the e2e test config as regexps instead of plain
strings. This makes it a lot easier to maintain a config file where
multiple nodes share configuration.
2020-10-22 21:46:29 +03:00
Markus Lehtonen
331f56ecc3 test/e2e: drop hostNetwork from worker pod spec
We don't need or use that anymore.
2020-05-25 16:37:38 +03:00
Markus Lehtonen
ff2c30a63c test/e2e: slightly more informative test output 2020-05-25 16:37:27 +03:00
Markus Lehtonen
00ccbe95bb test/e2e: fail faster waiting on master pod
Reduce timeout from the default 5 minutes to one minute. Error out
faster e.g. if accidentally trying to test a non-existing image.
2020-05-25 13:16:56 +03:00
Markus Lehtonen
2f4e038f10 test/e2e: drop dot imports
Make linter happy.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
73602e8f28 test/e2e: goling fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
409dc11389 Switch to sigs.k8s.io/yaml
Replace github.com/ghodss/yaml.
2020-04-23 16:54:14 +03:00
Markus Lehtonen
3d5866a06d test/e2e: more comprehensive per-node testing
Implement an end-to-end test with all feature sources enabled. The new
test runs nfd-worker as a daemonset on all (schedulable) nodes of the
test cluster which makes it possible to cover a wide range features,
assuming the test cluster is heterogenous containing nodes with varying
system configurations.

The features available depends on the node(s) the e2e testa are run on.
Thus, some runtime parameterization of the tests is needed. The patch
adds a new command line test flag 'nfd.e2e-config' that is used to
specify the per-node feature labels and annotations that is expected to
be present in the cluster. An example configuration file is provided
with the patch. The pod spec of nfd-worker deployment is changed to
better correspond the default deployment and thus enable wider feature
discovery. This means using hostnetwork and adding mounts for /sys /boot
and /etc/os-release.

The patch changes node object management so that all nfd-related labels
are removed after each test (not just the ones the test is expected to
add). Also, all nfd-related annotations are now removed.
2020-02-28 10:37:26 +02:00
Markus Lehtonen
54eaf16871 nfd-master: export label and annotation prefixes
In order to be able to use the constants in end-to-end tests.
2020-02-27 14:21:00 +02:00
Markus Lehtonen
974310251c test/e2e: adapt new wireframe to nfd context
Adapt the end-to-end test wireframe (copied from Kubernetes in the
previous commit) to node-feature-discovery.
2020-02-05 19:35:41 +02:00
Markus Lehtonen
e263c95adc test/e2e: re-copy e2e wireframe from Kubernetes
Sync with Kubernetes. Copy a wireframe for end-to-end tests directly
from Kubernetes v1.17.2.
2020-02-05 17:12:11 +02:00
Markus Lehtonen
0911de1978 Add simple e2e test
Tests that nfd master-worker communication works and that the worker is
able to label the node with the labels from the 'fake' source.

An example of running the test suite with a custom image with user's
kubeconfig:
$ go test ./test/e2e/ -args -nfd.repo=<image-repo> -nfd.tag=<image-tag> \
            -kubeconfig=$HOME/.kube/config

Partly based on some previous work done by Balaji Subramaniam.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
9065c7adbe Add empty e2e test stub
Patch the (Kubernetes) e2e wireframe introduced in the previous commit with some minor
modifications, dropping some bits in order to simplify the code.

Also adds a dummy test stub for node feature discovery.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
b284b2f42b Copy e2e wireframe from Kubernetes
Copy E2E wireframe directly from Kubernetes v1.13.5.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
35d26001e4 nfd-worker: extend unit test to cover 'main'
Also, adds new method WaitForReady() into NfdMaster.

In practice, this quite widely tests nfd-master, too, as the tests
create an instance of NfdMaster and verify that the communication
between master and worker works.
2019-05-06 16:26:41 +03:00