Adapt the libssl test harness testing scripts to new testing framework
[openssl.git] / test / recipes / 70-test_sslskewith0p.t
similarity index 85%
rename from test/sslskewith0ptest.pl
rename to test/recipes/70-test_sslskewith0p.t
index 63f83980a869b9e5358839015a2e788a09e5f073..d8d74b33e3f2fbaabf8074e06e8e76de8745a56a 100755 (executable)
 # Hudson (tjh@cryptsoft.com).
 
 use strict;
+use OpenSSL::Test qw/:DEFAULT cmdstr top_file top_dir/;
 use TLSProxy::Proxy;
 
+my $test_name = "test_sslskewith0p";
+setup($test_name);
+
+plan skip_all => "$test_name can only be performed with OpenSSL configured shared"
+    unless (map { chomp; s/^SHARED_LIBS=\s*//; $_ }
+           grep { /^SHARED_LIBS=/ }
+           do { local @ARGV = ( top_file("Makefile") ); <> })[0] ne "";
+
+$ENV{OPENSSL_ENGINES} = top_dir("engines");
+$ENV{OPENSSL_ia32cap} = '~0x200000200000000';
 my $proxy = TLSProxy::Proxy->new(
     \&ske_0_p_filter,
-    @ARGV
+    cmdstr(app(["openssl"])),
+    top_file("apps", "server.pem")
 );
 
+plan tests => 1;
+
 #We must use an anon DHE cipher for this test
 $proxy->cipherc('ADH-AES128-SHA:@SECLEVEL=0');
 $proxy->ciphers('ADH-AES128-SHA:@SECLEVEL=0');
 
 $proxy->start();
-TLSProxy::Message->fail or die "FAILED: ServerKeyExchange with 0 p\n";
-
-print "SUCCESS: ServerKeyExchange with 0 p\n";
+ok(TLSProxy::Message->fail, "ServerKeyExchange with 0 p");
 
 sub ske_0_p_filter
 {