xref: /freebsd/crypto/openssl/test/ssl_test.tmpl (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy Schubert[{-$testname-}]
2*e0c4386eSCy Schubertssl_conf = {-$testname-}-ssl
3*e0c4386eSCy Schubert
4*e0c4386eSCy Schubert[{-$testname-}-ssl]
5*e0c4386eSCy Schubertserver = {-$testname-}-server
6*e0c4386eSCy Schubertclient = {-$testname-}-client{-
7*e0c4386eSCy Schubert    # The following sections are optional.
8*e0c4386eSCy Schubert    $OUT = "";
9*e0c4386eSCy Schubert    if (%server2) {
10*e0c4386eSCy Schubert        $OUT .= "\nserver2 = $testname-server2";
11*e0c4386eSCy Schubert    } elsif ($reuse_server2) {
12*e0c4386eSCy Schubert        $OUT .= "\nserver2 = $testname-server";
13*e0c4386eSCy Schubert    }
14*e0c4386eSCy Schubert    if (%resume_server) {
15*e0c4386eSCy Schubert        $OUT .= "\nresume-server = $testname-resume-server";
16*e0c4386eSCy Schubert    } elsif ($reuse_resume_server) {
17*e0c4386eSCy Schubert        $OUT .= "\nresume-server = $testname-server";
18*e0c4386eSCy Schubert    }
19*e0c4386eSCy Schubert    if (%resume_client) {
20*e0c4386eSCy Schubert        $OUT .= "\nresume-client = $testname-resume-client";
21*e0c4386eSCy Schubert    } elsif ($reuse_resume_client) {
22*e0c4386eSCy Schubert        $OUT .= "\nresume-client = $testname-client";
23*e0c4386eSCy Schubert    }
24*e0c4386eSCy Schubert-}
25*e0c4386eSCy Schubert
26*e0c4386eSCy Schubert[{-$testname-}-server]
27*e0c4386eSCy Schubert{-
28*e0c4386eSCy Schubert    foreach my $key (sort keys %server) {
29*e0c4386eSCy Schubert        # Emitted in the test section.
30*e0c4386eSCy Schubert        next if ($key eq "extra");
31*e0c4386eSCy Schubert        $OUT .= qq{$key} . " = " . qq{$server{$key}\n} if defined $server{$key};
32*e0c4386eSCy Schubert    }
33*e0c4386eSCy Schubert    if (%server2) {
34*e0c4386eSCy Schubert        $OUT .= "\n[$testname-server2]\n";
35*e0c4386eSCy Schubert        foreach my $key (sort keys %server2) {
36*e0c4386eSCy Schubert            next if ($key eq "extra");
37*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$server2{$key}\n} if defined $server2{$key};
38*e0c4386eSCy Schubert        }
39*e0c4386eSCy Schubert    }
40*e0c4386eSCy Schubert    if (%resume_server) {
41*e0c4386eSCy Schubert        $OUT .= "\n[$testname-resume-server]\n";
42*e0c4386eSCy Schubert        foreach my $key (sort keys %resume_server) {
43*e0c4386eSCy Schubert            next if ($key eq "extra");
44*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$resume_server{$key}\n} if defined $resume_server{$key};
45*e0c4386eSCy Schubert        }
46*e0c4386eSCy Schubert    }
47*e0c4386eSCy Schubert-}
48*e0c4386eSCy Schubert[{-$testname-}-client]
49*e0c4386eSCy Schubert{-
50*e0c4386eSCy Schubert    foreach my $key (sort keys %client) {
51*e0c4386eSCy Schubert        next if ($key eq "extra");
52*e0c4386eSCy Schubert        $OUT .= qq{$key} . " = " . qq{$client{$key}\n} if defined $client{$key};
53*e0c4386eSCy Schubert    }
54*e0c4386eSCy Schubert    if (%resume_client) {
55*e0c4386eSCy Schubert        $OUT .= "\n[$testname-resume-client]\n";
56*e0c4386eSCy Schubert        foreach my $key (sort keys %resume_client) {
57*e0c4386eSCy Schubert	    next if ($key eq "extra");
58*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$resume_client{$key}\n} if defined $resume_client{$key};
59*e0c4386eSCy Schubert        }
60*e0c4386eSCy Schubert    }
61*e0c4386eSCy Schubert-}
62*e0c4386eSCy Schubert[test-{-$idx-}]
63*e0c4386eSCy Schubert{-
64*e0c4386eSCy Schubert    foreach my $key (sort keys %test) {
65*e0c4386eSCy Schubert        $OUT .= qq{$key} ." = " . qq{$test{$key}\n} if defined $test{$key};
66*e0c4386eSCy Schubert    }
67*e0c4386eSCy Schubert
68*e0c4386eSCy Schubert    # The extra server/client configuration sections.
69*e0c4386eSCy Schubert    if ($server{"extra"}) {
70*e0c4386eSCy Schubert       $OUT .= "server = $testname-server-extra\n";
71*e0c4386eSCy Schubert    }
72*e0c4386eSCy Schubert    if (%server2 && $server2{"extra"}) {
73*e0c4386eSCy Schubert       $OUT .= "server2 = $testname-server2-extra\n";
74*e0c4386eSCy Schubert    } elsif ($reuse_server2 && $server{"extra"}) {
75*e0c4386eSCy Schubert       $OUT .= "server2 = $testname-server-extra\n";
76*e0c4386eSCy Schubert    }
77*e0c4386eSCy Schubert    if (%resume_server && $resume_server{"extra"}) {
78*e0c4386eSCy Schubert       $OUT .= "resume-server = $testname-resume-server-extra\n";
79*e0c4386eSCy Schubert    } elsif ($reuse_resume_server && $server{"extra"}) {
80*e0c4386eSCy Schubert       $OUT .= "resume-server = $testname-server-extra\n";
81*e0c4386eSCy Schubert    }
82*e0c4386eSCy Schubert    if ($client{"extra"}) {
83*e0c4386eSCy Schubert       $OUT .= "client = $testname-client-extra\n";
84*e0c4386eSCy Schubert    }
85*e0c4386eSCy Schubert    if (%resume_client && $resume_client{"extra"}) {
86*e0c4386eSCy Schubert       $OUT .= "resume-client = $testname-resume-client-extra\n";
87*e0c4386eSCy Schubert    } elsif ($reuse_resume_client && $client{"extra"}) {
88*e0c4386eSCy Schubert       $OUT .= "resume-client = $testname-client-extra\n";
89*e0c4386eSCy Schubert    }
90*e0c4386eSCy Schubert
91*e0c4386eSCy Schubert    if ($server{"extra"}) {
92*e0c4386eSCy Schubert        $OUT .= "\n[$testname-server-extra]\n";
93*e0c4386eSCy Schubert        foreach my $key (sort keys %{$server{"extra"}}) {
94*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$server{"extra"}{$key}\n}
95*e0c4386eSCy Schubert	    	 if defined $server{"extra"}{$key};
96*e0c4386eSCy Schubert        }
97*e0c4386eSCy Schubert    }
98*e0c4386eSCy Schubert    if (%server2 && $server2{"extra"}) {
99*e0c4386eSCy Schubert        $OUT .= "\n[$testname-server2-extra]\n";
100*e0c4386eSCy Schubert        foreach my $key (sort keys %{$server2{"extra"}}) {
101*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$server2{"extra"}{$key}\n}
102*e0c4386eSCy Schubert	    	 if defined $server2{"extra"}{$key};
103*e0c4386eSCy Schubert        }
104*e0c4386eSCy Schubert    }
105*e0c4386eSCy Schubert   if (%resume_server && $resume_server{"extra"}) {
106*e0c4386eSCy Schubert        $OUT .= "\n[$testname-resume-server-extra]\n";
107*e0c4386eSCy Schubert        foreach my $key (sort keys %{$resume_server{"extra"}}) {
108*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$resume_server{"extra"}{$key}\n}
109*e0c4386eSCy Schubert	    	 if defined $resume_server{"extra"}{$key};
110*e0c4386eSCy Schubert        }
111*e0c4386eSCy Schubert    }
112*e0c4386eSCy Schubert   if ($client{"extra"}) {
113*e0c4386eSCy Schubert        $OUT .= "\n[$testname-client-extra]\n";
114*e0c4386eSCy Schubert        foreach my $key (sort keys %{$client{"extra"}}) {
115*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$client{"extra"}{$key}\n}
116*e0c4386eSCy Schubert	    	 if defined $client{"extra"}{$key};
117*e0c4386eSCy Schubert        }
118*e0c4386eSCy Schubert   }
119*e0c4386eSCy Schubert   if (%resume_client && $resume_client{"extra"}) {
120*e0c4386eSCy Schubert        $OUT .= "\n[$testname-resume-client-extra]\n";
121*e0c4386eSCy Schubert        foreach my $key (sort keys %{$resume_client{"extra"}}) {
122*e0c4386eSCy Schubert            $OUT .= qq{$key} . " = " . qq{$resume_client{"extra"}{$key}\n}
123*e0c4386eSCy Schubert	    	 if defined $resume_client{"extra"}{$key};
124*e0c4386eSCy Schubert        }
125*e0c4386eSCy Schubert    }
126*e0c4386eSCy Schubert-}
127