]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/90-test_shlibload.t
2 # Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 use OpenSSL
::Test qw
/:DEFAULT srctop_dir bldtop_dir/;
10 use OpenSSL
::Test
::Utils
;
15 setup
("test_shlibload");
17 use lib srctop_dir
('Configurations');
18 use lib bldtop_dir
('.');
21 plan skip_all
=> "Test only supported in a shared build" if disabled
("shared");
22 plan skip_all
=> "Test is disabled on AIX" if config
('target') =~ m
|^aix
|;
23 plan skip_all
=> "Test is disabled on NonStop" if config
('target') =~ m
|^nonstop
|;
24 plan skip_all
=> "Test only supported in a dso build" if disabled
("dso");
25 plan skip_all
=> "Test is disabled in an address sanitizer build" unless disabled
("asan");
26 plan skip_all
=> "Test is disabled if no-atexit is specified" if disabled
("atexit");
30 my $libcrypto = platform
->sharedlib('libcrypto');
31 my $libssl = platform
->sharedlib('libssl');
34 $atexit_outfile = 'atexit-cryptofirst.txt';
35 1 while unlink $atexit_outfile;
36 ok
(run
(test
(["shlibloadtest", "-crypto_first", $libcrypto, $libssl, $atexit_outfile])),
37 "running shlibloadtest -crypto_first $atexit_outfile");
38 ok
(check_atexit
($atexit_outfile));
40 $atexit_outfile = 'atexit-sslfirst.txt';
41 1 while unlink $atexit_outfile;
42 ok
(run
(test
(["shlibloadtest", "-ssl_first", $libcrypto, $libssl, $atexit_outfile])),
43 "running shlibloadtest -ssl_first $atexit_outfile");
44 ok
(check_atexit
($atexit_outfile));
46 $atexit_outfile = 'atexit-justcrypto.txt';
47 1 while unlink $atexit_outfile;
48 ok
(run
(test
(["shlibloadtest", "-just_crypto", $libcrypto, $libssl, $atexit_outfile])),
49 "running shlibloadtest -just_crypto $atexit_outfile");
50 ok
(check_atexit
($atexit_outfile));
52 $atexit_outfile = 'atexit-dsoref.txt';
53 1 while unlink $atexit_outfile;
54 ok
(run
(test
(["shlibloadtest", "-dso_ref", $libcrypto, $libssl, $atexit_outfile])),
55 "running shlibloadtest -dso_ref $atexit_outfile");
56 ok
(check_atexit
($atexit_outfile));
58 $atexit_outfile = 'atexit-noatexit.txt';
59 1 while unlink $atexit_outfile;
60 ok
(run
(test
(["shlibloadtest", "-no_atexit", $libcrypto, $libssl, $atexit_outfile])),
61 "running shlibloadtest -no_atexit $atexit_outfile");
62 ok
(!check_atexit
($atexit_outfile));
67 open my $fh, '<', $filename;
68 return 0 unless defined $fh;
72 return 1 if (defined $data && $data =~ m/atexit\(\) run/);