From: Martin Kletzander Date: Wed, 30 Aug 2017 08:50:17 +0000 (+0200) Subject: tests: Fix virnetsockettest after SSH command line changes X-Git-Tag: v3.7.0-rc2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21864e28ad26aec21d75b4d9b67b09acc800bf0e;p=thirdparty%2Flibvirt.git tests: Fix virnetsockettest after SSH command line changes Commit e4cb8500810a changed the way ssh command line is created by adding '--' before the hostname in order to fix a potential security flaw. However it failed to modify the tests, so let's do that. Signed-off-by: Martin Kletzander --- diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index c36886137a..9f9a243484 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -491,7 +491,7 @@ mymain(void) struct testSSHData sshData1 = { .nodename = "somehost", .path = "/tmp/socket", - .expectOut = "somehost sh -c 'if 'nc' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " + .expectOut = "-- somehost sh -c 'if 'nc' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " "ARG=;" @@ -509,7 +509,7 @@ mymain(void) .noTTY = true, .noVerify = false, .path = "/tmp/socket", - .expectOut = "-p 9000 -l fred -T -o BatchMode=yes -e none somehost sh -c '" + .expectOut = "-p 9000 -l fred -T -o BatchMode=yes -e none -- somehost sh -c '" "if 'netcat' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " @@ -528,7 +528,7 @@ mymain(void) .noTTY = false, .noVerify = true, .path = "/tmp/socket", - .expectOut = "-p 9000 -l fred -o StrictHostKeyChecking=no somehost sh -c '" + .expectOut = "-p 9000 -l fred -o StrictHostKeyChecking=no -- somehost sh -c '" "if 'netcat' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " @@ -550,7 +550,7 @@ mymain(void) struct testSSHData sshData5 = { .nodename = "crashyhost", .path = "/tmp/socket", - .expectOut = "crashyhost sh -c " + .expectOut = "-- crashyhost sh -c " "'if 'nc' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " @@ -567,7 +567,7 @@ mymain(void) .path = "/tmp/socket", .keyfile = "/root/.ssh/example_key", .noVerify = true, - .expectOut = "-i /root/.ssh/example_key -o StrictHostKeyChecking=no example.com sh -c '" + .expectOut = "-i /root/.ssh/example_key -o StrictHostKeyChecking=no -- example.com sh -c '" "if 'nc' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " @@ -582,7 +582,7 @@ mymain(void) .nodename = "somehost", .netcat = "nc -4", .path = "/tmp/socket", - .expectOut = "somehost sh -c 'if ''nc -4'' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " + .expectOut = "-- somehost sh -c 'if ''nc -4'' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then " "ARG=-q0;" "else " "ARG=;"