From f0db85daa92ea1d0b94d158cab54e89b11d16966 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 3 Feb 2022 08:17:47 +0100 Subject: [PATCH] e2e: use `pstree` instead of `ps` for checking rbd-nbd process The CentOS Stream 8 base container image does not have `ps` installed. This causes CI jobs to fail, when checking for a restarted rbd-nbd process. Instead of using `ps`, the `pstree` command can be used. This will add some ASCII-tree symbols in front of the command that is logged by the e2e tests, but that is only used for manual reviewing and does not harm the running test. Fixes: #2850 Signed-off-by: Niels de Vos (cherry picked from commit 693aabbe1e5905c237d489e9a56596eac190d154) --- e2e/rbd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/rbd.go b/e2e/rbd.go index d39d99aef..3798357c8 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -1266,11 +1266,11 @@ var _ = Describe("RBD", func() { var runningAttachCmd string runningAttachCmd, stdErr, err = execCommandInContainer( f, - "ps -eo 'cmd' | grep [r]bd-nbd", + "pstree --arguments | grep [r]bd-nbd", cephCSINamespace, "csi-rbdplugin", &opt) - // if the rbd-nbd process is not running the ps | grep command + // if the rbd-nbd process is not running the 'grep' command // will return with exit code 1 if err != nil { if strings.Contains(err.Error(), "command terminated with exit code 1") {