travis: fix kernel update check
PATCH 1/1 travis: fix kernel update check
We need to run ssh without -tt to get the correct output and also run dnf with -q to exclude the repo cache update lines. Also, ssh has trouble with quoting of arguments, so we need to pipe the command via stdin.
Moreover, dnf check-update doesn't seem to do what we need here. Rather use dnf -q info --avail, which is also more straightforward to use.
--- travis-ci/run-kvm-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
travis-ci/run-kvm-test.sh +3 -3
@@ -123,9 +123,9 @@ fi # Check if kernel-modules-$(uname -r) can be installed from repos, # otherwise update kernel and reboot. -kernel_avail="$(ssh -tt -o StrictHostKeyChecking=no -q "root@$ipaddy" \ - sh -c "dnf check-update kernel-modules-\$(uname -r) | wc -l")" -if [ $kernel_avail -eq 0 ]; then +if ! echo "dnf -q info --available kernel-modules-\$(uname -r)" | \ + ssh -o StrictHostKeyChecking=no -q "root@$ipaddy" +then ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy" \ dnf update -y kernel-core
Signature · 1 line
2.26.2
Ondrej Mosnacek
AppliedQuoted 31 lines · Ondrej Mosnacek
We need to run ssh without -tt to get the correct output and also run dnf with -q to exclude the repo cache update lines. Also, ssh has trouble with quoting of arguments, so we need to pipe the command via stdin.
Moreover, dnf check-update doesn't seem to do what we need here. Rather use
dnf -q info --avail, which is also more straightforward to use.Signed-off-by Ondrej Mosnacek <[email protected]>--- travis-ci/run-kvm-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)travis-ci/run-kvm-test.sh +3
-4@@ -123,9 +123,9 @@ fi # Check if kernel-modules-$(uname -r) can be installed from repos, # otherwise update kernel and reboot. -kernel_avail="$(ssh -tt -o StrictHostKeyChecking=no -q "root@$ipaddy" \ - sh -c "dnf check-update kernel-modules-\$(uname -r) | wc -l")" -if [ $kernel_avail -eq 0 ]; then +if ! echo "dnf -q info --available kernel-modules-\$(uname -r)" | \ + ssh -o StrictHostKeyChecking=no -q "root@$ipaddy" +then ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy" \ dnf update -y kernel-core --
Quoted 1 line
2.26.2
Applied:
https://github.com/SELinuxProject/selinux-testsuite/commit/10a0b5dacd2c4108253064bb31f9218782e4403f
Signature · 3 lines
Ondrej Mosnacek Software Engineer, Platform Security - SELinux kernel Red Hat, Inc.