81-test_cmp_cli.t: Do connections to 127.0.0.1 (e.g., Mock server) without proxy
[oweals/openssl.git] / test / recipes / 20-test_provider.t
index 0cfd81d09b8d0c052eaed03a7158e8af6d1a5c94..6713653214703d8ddc2e4939c08312f3d35a190f 100644 (file)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -14,7 +14,7 @@ use OpenSSL::Test;
 
 setup("test_provider");
 
-plan tests => 7;
+plan tests => 9;
 
  SKIP: {
      skip "No default provider?", 6
@@ -45,3 +45,18 @@ plan tests => 7;
      }
 }
 
+ SKIP: {
+     skip "No null provider?", 1
+         unless ok(run(app([qw(openssl provider null)])),
+                   "try running 'openssl provider null'");
+
+     my @cmd = ('openssl', 'provider', '-vvv', 'null');
+     my @lines = ( map { (my $x = $_) =~ s|\R$||; $x }
+                   run(app([@cmd]), capture => 1) );
+
+     my $curr = scalar @lines;
+     my $cmp = "$curr == 1";
+     ok(eval $cmp,
+        "'openssl provider $_ default' line count == 1");
+}
+