]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
tests: Do not run SSH tests when ssh agent is not detected
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 7 Sep 2017 09:30:56 +0000 (11:30 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 7 Sep 2017 09:37:17 +0000 (11:37 +0200)
... such as when building debian package.

tests/server.wv

index 233cc9686c6e4aa040745178259e6d21c2183a1e..928c655860f9c3806557081e177cfbe83a568204 100755 (executable)
@@ -109,6 +109,11 @@ SHELLRC="$WV_BASE_DIR/home-novaboot-test/.novaboot-shell"
 TFTPROOT="$WV_BASE_DIR/home-novaboot-test/tftproot"
 AUTH="$WV_BASE_DIR/home-novaboot-test/.ssh/authorized_keys"
 
+if [ -z "$SSH_AUTH_SOCK" ]; then
+    WVSTART "!!! Skipping SSH tests because no ssh-agent was detected !!!"
+    exit 0
+fi
+
 WVSTART "Setup SSH server's admin key"
 WVPASS ssh-add -L > keys
 WVPASS test $(wc -l < keys) -gt 0