Commit Graph

31 Commits

Author SHA1 Message Date
David Porter
7fe371a974 test: Simplify NPD start timestamp calculation
The NPD test checks when NPD started to determine if it is needed to
check the kubelet start event. The current logic requires parsing the
journalctl logs which is quite fragile and is broken now because of
systemd changing the expected log format.

Newer versions of systemd do not print "end at" or "logs begin at" and
instead may print "No entries", which will result in the test panicking.

```
$ journalctl -u foo.service
-- No entries --
```

For units started, it will not print "end at" or "logs begin at":

```
root@ubuntu-jammy:~# journalctl -u foo.service
Feb 08 22:02:19 ubuntu-jammy systemd[1]: Started /usr/bin/sleep 1s.
Feb 08 22:02:20 ubuntu-jammy systemd[1]: foo.service: Deactivated successfully.
```

To avoid relying on log parsing which is fragile, let's instead directly
ask systemd when the NPD service started and parse the resulting
timestamp.

Signed-off-by: David Porter <david@porter.me>
2023-02-08 13:58:45 -08:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Patrick Ohly
df5d84ae81 e2e: accept context from Ginkgo
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.

This is a first automated step towards that: the additional parameter got added
with

    sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
        $(git grep -l -e framework.ConformanceIt -e ginkgo.It )
    $GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')

log_test.go was left unchanged.
2022-12-10 19:50:18 +01:00
David Porter
d906521acd test: Only Check NPD logs in standalone mode
NPD can run in "standalone" or "daemonset" mode in cluster GCE tests.

For standalone mode, NPD runs as a systemd unit, daemonset mode it runs
as pod.

If NPD is running in standalone mode, as soon as we detect that the npd
service does not exist with `systemctl status`, we should skip the rest
of the checks such as looking at the journalctl logs or pid.

Signed-off-by: David Porter <david@porter.me>
2022-07-19 01:03:13 -07:00
Dave Chen
857458cfa5 update ginkgo from v1 to v2 and gomega to 1.19.0
- update all the import statements
- run hack/pin-dependency.sh to change pinned dependency versions
- run hack/update-vendor.sh to update go.mod files and the vendor directory
- update the method signatures for custom reporters

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:44:46 +08:00
Sergey Kanzhelev
4eb2c570f7 check for the test duraiton to make NodeProblemDetector test reliable in long running environments 2022-04-28 22:05:55 +00:00
Sergiusz Urbaniak
1495c9f2cd
test/e2e/*: default existing tests to privileged pod security policy
This is to ensure that all existing tests don't break when defaulting
the pod security policy to restricted in the e2e test framework.
2022-04-05 08:41:12 +02:00
Nikhil Sharma
0316542704 Changed code to improve output for files under test/e2e/node 2021-11-04 20:09:59 +05:30
David Porter
d28db6ee0c Support cgroupv2 in node problem detector test 2021-10-18 19:50:45 -07:00
Julie Qi
c35502ad4b Remove AUFSUmountHung from NPD test 2021-08-02 11:37:30 -07:00
wojtekt
d5e5f14508 Fix NPD test to run it in private and large clusters 2021-02-18 08:07:22 +01:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
tanjunchen
8c481022c1 e2e/node/:Use e2eskipper package 2020-01-10 16:21:12 +08:00
mattjmcnaughton
69a473be38
Address staticcheck failures for test/e2e/node/...
Fix the `staticcheck` failures for `test/e2e/node`. All of the
staticcheck errors were for variables which were never used. When these
values were `err`, we added processing for the errors. When they were
values that were just never used, we stopped giving them a name.
2019-10-09 10:26:11 -04:00
Dan Winship
71b02dd422 Fix up e2enode.GetReadySchedulableNodes, replace many uses of framework.GetReadySchedulableNodesOrDie
Remove the "OrDie" from the name (since it doesn't "or die") and add
an extra check that there is at least 1 node available, since many
callers already did that themselves, and many others should have.
2019-09-24 13:03:39 -04:00
carlory
d1290ffdef clean up test code 2019-09-05 23:44:19 +08:00
Zhen Wang
d874dbfcb1 Bump NPD version to v0.7 for GCI 2019-08-27 22:26:30 -07:00
Kenichi Omichi
0d2e5866d4 Use framework functions under test/e2e/node/
There are some functions of e2e test framework and it is useful to
read the test code by using these functions.
This replaces gomega calls with these functions under test/e2e/node/
2019-08-21 02:01:49 +00:00
John Schnake
37212fa934 Ensure tests which rely on SSH behavior are skipped if unavailable
A number of tests rely on SSH behavior but are not marked with
SkipUnlessSSHKeysPresent(). This means that the tests will run and
hang. This can be confusing for users because they may not know why
the tests failed. Instead, we should be reporting on the known issue
and skipping the test (hence why the helper Skip... function exists).
2019-08-07 10:24:39 -05:00
WanLinghao
92b0310cc5 Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/kubelet_stats.go file 2019-08-01 17:40:02 +08:00
SataQiu
03e4527a87 e2e: use framework.ExpectEqual() for test/e2e/node 2019-07-04 20:21:04 +08:00
Jiatong Wang
b1c346c295 Move node related methods to framework/node package
- Add a package "node" under e2e/framework and alias e2enode;
- Rename some functions whose name have redundant string.

Signed-off-by: Jiatong Wang <wangjiatong@vmware.com>
2019-06-17 16:59:07 -07:00
danielqsj
124efde4f8 fix golint error in e2e/node 2019-05-12 07:35:13 +08:00
danielqsj
087bc1369e remove dot imports in e2e/node 2019-05-12 07:32:26 +08:00
John Schnake
338bc3ce42 Move framework ssh code to new package
The framework/ssh.go code was heavily used throughout the framework
and could be useful elsewhere but reusing those methods requires
importing all of the framework.

Extracting these methods to their own package for reuse.

Only a few methods had to be copied into this package from the
rest of the framework to avoid an import cycle.
2019-05-08 11:00:36 -05:00
John Schnake
2ede81c2a6 Move node, windows, and autoscaling tests to framework/log
This is part of the transition to using framework/log instead
of the Logf inside the framework package. This will help with
import size/cycles when importing the framework or subpackages.
2019-05-03 13:23:57 -05:00
Kubernetes Prow Robot
faaec7f997
Merge pull request #75177 from mm4tt/node-problem-detector
Disable NodeProblemDector test in large clusters.
2019-03-09 11:31:29 -08:00
Matt Matejczyk
2f7cb25bbb Disable NodeProblemDector test in large clusters.
It's suspected of causing timeouts in scalability 5k node cluster
tests, see https://github.com/kubernetes/kubernetes/issues/75095#issuecomment-470912583
2019-03-08 13:35:12 +01:00
Zhen Wang
f4d9e7d992 Fix NPD e2e test on Ubuntu node and update NPD container version 2019-03-06 22:42:47 -08:00
Zhen Wang
87faa00a14 Fix NPD E2E test on clusters with Ubuntu nodes 2019-03-04 15:26:21 -08:00
Zhen Wang
efa96f7eb8 allows configuring NPD release and flags on GCI and add cluster e2e test 2019-02-26 21:21:54 -08:00