X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test%2F04-pkey.t;h=549d6572d341c181a82ad436331e0bca73ad1a06;hb=13ae67e29336182a2cd5718b56155216f0e3ddf5;hp=84ae81e0b51c516a6f97fe55fc39252a006c004e;hpb=daa886bfcc06d02a3d48967693d110db335429a6;p=openssl-gost%2Fengine.git diff --git a/test/04-pkey.t b/test/04-pkey.t index 84ae81e..549d657 100644 --- a/test/04-pkey.t +++ b/test/04-pkey.t @@ -1,32 +1,30 @@ #!/usr/bin/perl -use Test::More tests => 15; +use Test2::V0; +plan(15); use Cwd 'abs_path'; # # If this variable is set, engine would be loaded via configuration # file. Otherwise - via command line # -$use_config = 1; +my $use_config = 1; # prepare data for -# Set OPENSSL_ENGINES environment variable to just built engine -if(!defined $ENV{'OPENSSL_ENGINES'}){ - $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs"); -} - -$engine=$ENV{'ENGINE_NAME'}||"gost"; +my $engine=$ENV{'ENGINE_NAME'}||"gost"; # Reopen STDERR to eliminate extra output open STDERR, ">>","tests.err"; +my $F; +my $eng_param; -open F,">","test.cnf"; +open $F,">","test.cnf"; if (defined($use_config) && $use_config) { $eng_param = ""; - open F,">","test.cnf"; - print F <","test.cnf"; + print $F <",'tmp.pem'; - print F $seckey; - close F; + open $F,">",'tmp.pem'; + print $F $seckey; + close $F; #1. Прочитать секретный ключ и напечатать публичный и секретный ключи is(`openssl pkey -noout -text -in tmp.pem`,$sectext . $pubtext, "Print key pair $alg:$paramset"); #2. Прочитать секретный ключ и вывести публичный (все алгоритмы) is(`openssl pkey -pubout -in tmp.pem`,$pubkey, "Compute public key $alg:$paramset"); - open F,">","tmp.pem"; - print F $pubkey; - close F; + open $F,">","tmp.pem"; + print $F $pubkey; + close $F; #3. Прочитать публичный и напечать его в виде текста is(`openssl pkey -pubin -noout -in tmp.pem -text`,$pubtext, "Read and print public key $alg:paramset");