Added tests to the test suite in order to check the update.
authorFranck Joncourt <franck@debian.org>
Sun, 7 Apr 2013 17:00:38 +0000 (19:00 +0200)
committerFranck Joncourt <franck@debian.org>
Sun, 7 Apr 2013 17:00:38 +0000 (19:00 +0200)
test/local_spa.key
test/test-fwknop.pl
test/tests/client_nat.pl [new file with mode: 0644]

index d2eddbd..f4dc516 100644 (file)
@@ -1,3 +1,4 @@
 127.0.0.1: fwknoptest
 localhost: fwknoptest
 some.host.through.proxy.com: fwknoptest
+74.220.215.85: fwknoptest
index 65ef49c..5e92ac9 100755 (executable)
@@ -171,6 +171,7 @@ my @test_files = (
     "$tests_dir/python_fko.pl",
     "$tests_dir/gpg_no_pw.pl",
     "$tests_dir/gpg.pl",
+    "$tests_dir/client_nat.pl",
 );
 #================== end config ===================
 
@@ -189,6 +190,7 @@ our @gpg                     = ();  ### from tests/gpg.pl
 our @perl_FKO_module         = ();  ### from tests/perl_FKO_module.pl
 our @python_fko              = ();  ### from tests/python_fko.pl
 our @rijndael_backwards_compatibility = ();  ### from tests/rijndael_backwards_compatibility.pl
+our @client_nat_dns_resolution_fko = (); ### from tests/client_nat.pl
 
 my $passed = 0;
 my $failed = 0;
@@ -445,6 +447,7 @@ my @tests = (
     @python_fko,
     @gpg_no_pw,
     @gpg,
+    @client_nat_dns_resolution_fko,
 );
 
 my %test_keys = (
diff --git a/test/tests/client_nat.pl b/test/tests/client_nat.pl
new file mode 100644 (file)
index 0000000..5053399
--- /dev/null
@@ -0,0 +1,24 @@
+@client_nat_dns_resolution_fko = (
+    {
+        'category' => 'Franck',
+        'subcategory' => 'client nat-local',
+        'detail'   => 'Bad dns resolution in nat-local mode',
+        'function' => \&generic_exec,
+        'positive_output_matches' => [qr/Unable\sto\sresolve\swww.cipherdyne.co\sas\san\sip\saddress/i],
+        'exec_err' => $YES,
+        'cmdline'  => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+            "$fwknopCmd -a 1.2.3.4 -A tcp/22 --nat-local --nat-port 80 -D www.cipherdyne.co",
+        'fatal'    => $NO
+    },
+    {
+        'category' => 'Franck',
+        'subcategory' => 'client nat-local',
+        'detail'   => 'Good dns resolution in nat-local mode',
+        'function' => \&generic_exec,
+        'positive_output_matches' => [qr/Nat\sAccess:\s74.220.215.85,22/i],
+        'cmdline'  => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
+            "$fwknopCmd -a 1.2.3.4 -A tcp/22 --nat-local --nat-port 80 -D www.cipherdyne.com " .
+            "--get-key $local_key_file --no-save-args --verbose --verbose",
+        'fatal'    => $NO
+    },    
+);