[libvirt PATCH v2 5/6] virnetsockettest: Test more socket paths

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

 



While unlikely, the socket path might also contain unusual
characters that need special handling. Adjust test cases so that
these scenarios are covered.

Note that none of these inputs will actually work outside of the
test suite at the moment, but we're going to address that in the
next commit.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 tests/virnetsockettest.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 09c3ba13ad..ef7b5c6f59 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -668,14 +668,14 @@ mymain(void)
     struct testSSHData sshData7 = {
         .nodename = "somehost",
         .netcat = "n c",
-        .path = "/tmp/socket",
+        .path = "/tmp/sock et",
         .expectOut = "-T -e none -- somehost sh -c '"
                          "if '''\\''n c'\\'''' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then "
                              "ARG=-q0; "
                          "else "
                              "ARG=; "
                          "fi; "
-                         "'''\\''n c'\\'''' $ARG -U /tmp/socket"
+                         "'''\\''n c'\\'''' $ARG -U /tmp/sock et"
                      "'\n",
     };
     if (virTestRun("SSH test 7", testSocketSSH, &sshData7) < 0)
@@ -684,14 +684,14 @@ mymain(void)
     struct testSSHData sshData8 = {
         .nodename = "somehost",
         .netcat = "n'c",
-        .path = "/tmp/socket",
+        .path = "/tmp/sock'et",
         .expectOut = "-T -e none -- somehost sh -c '"
                          "if '''\\''n'\\''\\'\\'''\\''c'\\'''' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then "
                              "ARG=-q0; "
                          "else "
                              "ARG=; "
                          "fi; "
-                         "'''\\''n'\\''\\'\\'''\\''c'\\'''' $ARG -U /tmp/socket"
+                         "'''\\''n'\\''\\'\\'''\\''c'\\'''' $ARG -U /tmp/sock'et"
                      "'\n",
     };
     if (virTestRun("SSH test 8", testSocketSSH, &sshData8) < 0)
@@ -700,14 +700,14 @@ mymain(void)
     struct testSSHData sshData9 = {
         .nodename = "somehost",
         .netcat = "n\"c",
-        .path = "/tmp/socket",
+        .path = "/tmp/sock\"et",
         .expectOut = "-T -e none -- somehost sh -c '"
                          "if '''\\''n\"c'\\'''' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then "
                              "ARG=-q0; "
                          "else "
                              "ARG=; "
                          "fi; "
-                         "'''\\''n\"c'\\'''' $ARG -U /tmp/socket"
+                         "'''\\''n\"c'\\'''' $ARG -U /tmp/sock\"et"
                      "'\n",
     };
     if (virTestRun("SSH test 9", testSocketSSH, &sshData9) < 0)
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux