[gvfs] test: Remove trailing newline from the IP string



commit 142d99cb117af76615f29bb08b042c9d72f5aa5c
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Feb 25 10:08:38 2019 +0100

    test: Remove trailing newline from the IP string
    
    test_unknown_host uses the following URI: sftp://10.220.47.158%0A:22222/.
    It contains %0A (newline character), which makes it invalid and may cause
    problems. Let's remove the trailing newline from the IP to make it valid.
    
    https://gitlab.gnome.org/GNOME/gvfs/issues/376

 test/gvfs-test | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 8b9e0284..73b4e2fb 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -69,7 +69,8 @@ have_httpd = httpd_cmd is not None
 sshd_path = shutil.which('sshd')
 
 local_ip = subprocess.check_output("ip -4 addr | sed -nr '/127\.0\.0/ n; "
-                                   "/inet / {  s/^.*inet ([0-9.]+).*$/\\1/; p; q  }'",
+                                   "/inet / {  s/^.*inet ([0-9.]+).*$/\\1/; p; q  }'"
+                                   "| tr -d '\n'",
                                    shell=True, universal_newlines=True)
 
 SMB_USER_PORT = 1445


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