Debian Codegraph @

mysql-test/suite/auth_sec/t/openssl_cert_validity.test

raw
1 --source include/no_valgrind_without_big.inc
2
3 --echo #
4 --echo # Bug#20923066 SSL AND RSA KEY MATERIAL EXPIRATION SHOULD BE EXTENDED
5 --echo #
6
7 let VALIDITY_START= `show status like 'Ssl_server_not_before'`;
8 let VALIDITY_END= `show status like 'Ssl_server_not_after'`;
9
10 perl;
11 my @start_date = $ENV{'VALIDITY_START'} =~ /(\d+:\d+:\d+) (\d+)/;
12 my @end_date = $ENV{'VALIDITY_END'} =~ /(\d+:\d+:\d+) (\d+)/;
13 my $cert_validity= $end_date[1] - $start_date[1];
14
15 # The default validity is 3650 days, which typically misses four leap days.
16 # Thus, if the day is Jan 1–5 (we add some extra padding), work around it.
17 if ($ENV{'VALIDITY_START'} =~ /Jan\s+[1-5]/ && $cert_validity == 9) {
18 ++$cert_validity;
19 }
20
21 print "Validity of certificate: $cert_validity years\n";
22 EOF