]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test/00-engine.t
tcl_tests: ca.try: Ignore openssl crl exit status for 'corrupted CRL' test
[openssl-gost/engine.git] / test / 00-engine.t
index b66e3ef2b12738555531d58bb13ddde2d6493ad4..0904a21aa4a720409989aef1cf6b00063709319f 100644 (file)
@@ -1,24 +1,22 @@
 #!/usr/bin/perl
-use Test::More tests => 7;
+use Test2::V0;
+skip_all('This test is only suitable for the engine')
+    unless $ARGV[0] eq 'engine';
+plan(7);
 use Cwd 'abs_path';
 
 # prepare data for 
 
-open F,">","testdata.dat";
-print F "12345670" x 128;
-close F;
+open (my $F,">","testdata.dat");
+print $F "12345670" x 128;
+close $F;
 
-# Set OPENSSL_ENGINES environment variable to just built engine
-if(!defined $ENV{'OPENSSL_ENGINES'}){
-       $ENV{'OPENSSL_ENGINES'} = abs_path("../.libs");
-}
-
-$key='0123456789abcdef' x 2;
+my $key='0123456789abcdef' x 2;
 
 #
 # You can redefine engine to use using ENGINE_NAME environment variable
 # 
-$engine=$ENV{'ENGINE_NAME'}||"gost";
+my $engine=$ENV{'ENGINE_NAME'}||"gost";
 
 # Reopen STDERR to eliminate extra output
 open STDERR, ">>","tests.err";
@@ -32,6 +30,8 @@ if (exists $ENV{'OPENSSL_CONF'}) {
 # ${ENGINE_NAME}.info into this directory if you use this test suite
 # to test other engine implementing GOST cryptography.
 #
+my $engine_info;
+
 if ( -f $engine . ".info") {
        diag("Reading $engine.info");
        open F, "<", $engine . ".info";
@@ -40,7 +40,7 @@ if ( -f $engine . ".info") {
 
 $engine_info= <<EOINF;
 (gost) Reference implementation of GOST engine
- [gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, grasshopper-ecb, grasshopper-cbc, grasshopper-cfb, grasshopper-ofb, grasshopper-ctr, magma-cbc, magma-ctr, id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, magma-mac, grasshopper-mac, id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac, gost2001, gost-mac, gost2012_256, gost2012_512, gost-mac-12, magma-mac, grasshopper-mac, id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac, id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac]
+ [gost89, gost89-cnt, gost89-cnt-12, gost89-cbc, kuznyechik-ecb, kuznyechik-cbc, kuznyechik-cfb, kuznyechik-ofb, kuznyechik-ctr, magma-ecb, kuznyechik-mgm, magma-cbc, magma-ctr, magma-ctr-acpkm, magma-ctr-acpkm-omac, magma-mgm, kuznyechik-ctr-acpkm, kuznyechik-ctr-acpkm-omac, magma-kexp15, kuznyechik-kexp15, md_gost94, gost-mac, md_gost12_256, md_gost12_512, gost-mac-12, magma-mac, kuznyechik-mac, kuznyechik-ctr-acpkm-omac, gost2001, id-GostR3410-2001DH, gost-mac, gost2012_256, gost2012_512, gost-mac-12, magma-mac, kuznyechik-mac, magma-ctr-acpkm-omac, kuznyechik-ctr-acpkm-omac]
 EOINF
 }
 
@@ -54,8 +54,8 @@ is(`openssl dgst -engine $engine -md_gost94 testdata.dat`,
 "compute digest without config");
 
 
-open F,">","test.cnf";
-print F <<EOCFG;
+open $F,">","test.cnf";
+print $F <<EOCFG;
 openssl_conf = openssl_def
 [openssl_def]
 engines = engines
@@ -65,7 +65,7 @@ ${engine}=gost_conf
 default_algorithms = ALL
 
 EOCFG
-close F;
+close $F;
 $ENV{'OPENSSL_CONF'}=abs_path('test.cnf');
 
 is(`openssl engine -c $engine`,