summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-02-16 11:13:08 +0100
committerFrediano Ziglio <fziglio@redhat.com>2018-03-02 17:16:17 +0000
commitd2700d3524e1ed4bbf4b725472854cb50f130d3a (patch)
tree309adc8137047c26907c43bed05d80acd45ff447 /tests
parent4e63a1339b58879d1c4b31e4ed7b05aa91c5a9c2 (diff)
tests: add spice+tls:// tests
They couldn't not be introduced before, because the test needs both parsing and generation. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/session.c24
1 files changed, 23 insertions, 1 deletions
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));