[PATCH testsuite] travis: fix kernel update check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <omosnace@xxxxxxxxxx>
---
 travis-ci/run-kvm-test.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/travis-ci/run-kvm-test.sh b/travis-ci/run-kvm-test.sh
index 6afbf96..3c19df8 100755
--- a/travis-ci/run-kvm-test.sh
+++ b/travis-ci/run-kvm-test.sh
@@ -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
 
-- 
2.26.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux