[PATCH spice-gtk v2 4/4] tests: add spice+tls:// tests

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

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

They couldn't not be introduced before, because the test needs both
parsing and generation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
---
 tests/session.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/tests/session.c b/tests/session.c
index fc874fc..f0ecda2 100644
--- a/tests/session.c
+++ b/tests/session.c
@@ -21,7 +21,7 @@ static void test_session_uri_bad(void)
         struct {
             const GLogLevelFlags log_level;
             const gchar *message;
-        } messages[2];
+        } messages[4];
     } uris[] = {
         {
             "scheme://host?port",
@@ -111,6 +111,25 @@ static void test_session_uri_bad(void)
                     "*assertion 's->port != NULL || s->tls_port != NULL' failed",
                 },
             }
+        },{
+            "spice+tls://hostname?tls-port=1234&port=3456",
+            {
+                {
+                    G_LOG_LEVEL_WARNING,
+                    "spice+tls:// scheme doesn't accept 'tls-port'",
+                },
+                {
+                    G_LOG_LEVEL_WARNING,
+                    "spice+tls:// scheme doesn't accept 'port'",
+                },
+                {
+                    G_LOG_LEVEL_WARNING,
+                    "Missing port or tls-port in spice URI *",
+                },{
+                    G_LOG_LEVEL_CRITICAL,
+                    "*assertion 's->port != NULL || s->tls_port != NULL' failed",
+                },
+            }
         },
     };
 
@@ -233,6 +252,9 @@ static void test_session_uri_ipv4_good(void)
           NULL, NULL,
           "spice://127.0.0.1:42?tls-port=5930",
           "spice://127.0.0.1?port=42&tls-port=5930" },
+        { .uri_input  = "spice+tls://hostname:39",
+          .host = "hostname",
+          .tls_port = "39" }
     };
 
     test_session_uri_good(tests, G_N_ELEMENTS(tests));
-- 
2.16.1.73.g5832b7e9f2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]