2
0

ssl_test.tmpl 4.3 KB

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