[test suite] IP resolution tests for client/http_resolve_host.c coverage
authorMichael Rash <mbr@cipherdyne.org>
Sat, 29 Mar 2014 18:53:52 +0000 (14:53 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sat, 29 Mar 2014 18:53:52 +0000 (14:53 -0400)
test/test-fwknop.pl
test/tests/rijndael.pl
test/tests/rijndael_hmac.pl

index 4ac139a..3153787 100755 (executable)
@@ -281,6 +281,8 @@ my $tarfile = 'test_fwknop.tar.gz';
 our $key_gen_file = "$output_dir/key_gen";
 our $verbose_str  = "--verbose --verbose";
 my $gdb_test_file = '';
+our $resolve_url = 'http://www.cipherdyne.org/cgi-bin/myip/';  ### with trailing slash for test coverage
+our $resolve_url_with_port = 'http://www.cipherdyne.org:80/cgi-bin/myip';
 my $fuzzing_pkts_file = '../perl/FKO/t/fuzzing_spa_packets';
 my $fuzzing_pkts_append = 0;
 my $fuzzing_key = 'testtest';
index e9cf037..42e3ab4 100644 (file)
         'fw_rule_created' => $NEW_RULE_REQUIRED,
         'fw_rule_removed' => $NEW_RULE_REMOVED,
     },
+    {
+        'category' => 'Rijndael',
+        'subcategory' => 'client+server',
+        'detail'   => 'client IP resolve manual URL',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$client_ip_resolve_args --resolve-url $resolve_url",
+        'no_ip_check' => 1,
+        'fwknopd_cmdline' => "$fwknopdCmd $default_server_conf_args $intf_str",
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+    },
+    {
+        'category' => 'Rijndael',
+        'subcategory' => 'client+server',
+        'detail'   => 'client IP resolve URL with port',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$client_ip_resolve_args --resolve-url $resolve_url_with_port",
+        'no_ip_check' => 1,
+        'fwknopd_cmdline' => "$fwknopdCmd $default_server_conf_args $intf_str",
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+    },
+
+    {
+        'category' => 'Rijndael',
+        'subcategory' => 'client',
+        'detail'   => 'client IP resolve HTTPS unsupported',
+        'function' => \&generic_exec,
+        'cmdline'  => "$client_ip_resolve_args --resolve-url https://somedomain.com/myip",
+        'no_ip_check' => 1,
+        'positive_output_matches' => [qr/not.*supported/i],
+        'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
+    },
+    {
+        'category' => 'Rijndael',
+        'subcategory' => 'client',
+        'detail'   => 'client IP resolve invalid port',
+        'function' => \&generic_exec,
+        'cmdline'  => "$client_ip_resolve_args --resolve-url http://somedomain.com:99999/myip",
+        'no_ip_check' => 1,
+        'positive_output_matches' => [qr/port.*invalid/i],
+        'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
+    },
 
     {
         'category' => 'Rijndael',
index a2ad364..aee9952 100644 (file)
     {
         'category' => 'Rijndael+HMAC',
         'subcategory' => 'client+server',
+        'detail'   => 'client IP resolve manual URL',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$client_ip_resolve_hmac_args --resolve-url $resolve_url",
+        'no_ip_check' => 1,
+        'fwknopd_cmdline' => "$fwknopdCmd $default_server_hmac_conf_args $intf_str",
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_hmac_b64_key'},
+    },
+    {
+        'category' => 'Rijndael+HMAC',
+        'subcategory' => 'client+server',
+        'detail'   => 'client IP resolve URL with port',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$client_ip_resolve_hmac_args --resolve-url $resolve_url_with_port",
+        'no_ip_check' => 1,
+        'fwknopd_cmdline' => "$fwknopdCmd $default_server_hmac_conf_args $intf_str",
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_hmac_b64_key'},
+    },
+    {
+        'category' => 'Rijndael+HMAC',
+        'subcategory' => 'client',
+        'detail'   => 'client IP resolve HTTPS unsupported',
+        'function' => \&generic_exec,
+        'cmdline'  => "$client_ip_resolve_hmac_args --resolve-url https://somedomain.com/myip",
+        'no_ip_check' => 1,
+        'positive_output_matches' => [qr/not.*supported/i],
+        'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
+    },
+    {
+        'category' => 'Rijndael+HMAC',
+        'subcategory' => 'client',
+        'detail'   => 'client IP resolve invalid port',
+        'function' => \&generic_exec,
+        'cmdline'  => "$client_ip_resolve_hmac_args --resolve-url http://somedomain.com:99999/myip",
+        'no_ip_check' => 1,
+        'positive_output_matches' => [qr/port.*invalid/i],
+        'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
+    },
+
+    {
+        'category' => 'Rijndael+HMAC',
+        'subcategory' => 'client+server',
         'detail'   => 'complete cycle MD5 (tcp/22 ssh)',
         'function' => \&spa_cycle,
         'cmdline'  => "$default_client_args_no_get_key --rc-file " .