Correct srp test
[openssl.git] / test / recipes / 80-test_cms.t
index 1775ac406766c657f4c100f2714137157c934171..079a4b2e55a2be03f23c88e0a482af012d9b92b5 100644 (file)
@@ -6,16 +6,14 @@ use warnings;
 use POSIX;
 use File::Spec::Functions qw/catfile/;
 use File::Compare qw/compare_text/;
-use Test::More;
 use OpenSSL::Test qw/:DEFAULT top_dir top_file/;
+use OpenSSL::Test::Utils;
 
 setup("test_cms");
 
 my $smdir    = top_dir("test", "smime-certs");
 my $smcont   = top_file("test", "smcont.txt");
-my $no_ec    = run(app(["openssl", "no-ec"], stdout => undef));
-my $no_ec2m  = run(app(["openssl", "no-ec2m"], stdout => undef));
-my $no_ecdh  = run(app(["openssl", "no-ecdh"], stdout => undef));
+my ($no_ec, $no_ec2m, $no_zlib) = disabled qw/ec ec2m zlib/;
 
 plan tests => 4;
 
@@ -443,10 +441,9 @@ subtest "CMS <=> CMS consistency tests, modified key parameters\n" => sub {
   SKIP: {
       skip("Zlib not supported: compression tests skipped",
           scalar @smime_cms_comp_tests)
-         unless grep /ZLIB/, run(app(["openssl", "version", "-f"]),
-                                 capture => 1);
+         if $no_zlib;
 
-      foreach (@smime_cms_param_tests) {
+      foreach (@smime_cms_comp_tests) {
        SKIP: {
            my $skip_reason = check_availability($$_[0]);
            skip $skip_reason, 1 if $skip_reason;
@@ -470,7 +467,7 @@ sub check_availability {
     return "$tnam: skipped, EC disabled\n"
        if ($no_ec && $tnam =~ /ECDH/);
     return "$tnam: skipped, ECDH disabled\n"
-       if ($no_ecdh && $tnam =~ /ECDH/);
+       if ($no_ec && $tnam =~ /ECDH/);
     return "$tnam: skipped, EC2M disabled\n"
        if ($no_ec2m && $tnam =~ /K-283/);
     return "";