diff tests/test-patchbomb-tls.t @ 29481:5caa415aa48b

tests: better testing of loaded certificates Tests were failing on systems like RHEL 7 where loading the system certificates results in CA certs being reported to Python. We add a feature that detects when we're able to load *and detect* the loading of system certificates. We update the tests to cover the 3 scenarios: 1) system CAs are loadable and detected 2) system CAs are loadable but not detected 3) system CAs aren't loadable
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 01 Jul 2016 19:27:34 -0700
parents 5b71a8d7f7ff
children 9c5325c79683
line wrap: on
line diff
--- a/tests/test-patchbomb-tls.t	Fri Jul 01 17:42:55 2016 +0200
+++ b/tests/test-patchbomb-tls.t	Fri Jul 01 19:27:34 2016 -0700
@@ -43,7 +43,7 @@
 Our test cert is not signed by a trusted CA. It should fail to verify if
 we are able to load CA certs:
 
-#if defaultcacerts
+#if sslcontext defaultcacerts no-defaultcacertsloaded
   $ try
   this patch series consists of 1 patches.
   
@@ -53,6 +53,35 @@
   [255]
 #endif
 
+#if no-sslcontext defaultcacerts
+  $ try
+  this patch series consists of 1 patches.
+  
+  
+  (?i)abort: .*?certificate.verify.failed.* (re)
+  [255]
+#endif
+
+#if defaultcacertsloaded
+  $ try
+  this patch series consists of 1 patches.
+  
+  
+  (?i)abort: .*?certificate.verify.failed.* (re)
+  [255]
+
+#endif
+
+#if no-defaultcacerts
+  $ try
+  this patch series consists of 1 patches.
+  
+  
+  abort: localhost certificate error: no certificate received
+  (set hostsecurity.localhost:certfingerprints=sha256:62:09:97:2f:97:60:e3:65:8f:12:5d:78:9e:35:a1:36:7a:65:4b:0e:9f:ac:db:c3:bc:6e:b6:a3:c0:16:e0:30 config setting or use --insecure to connect insecurely)
+  [255]
+#endif
+
   $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true"
 
 Without certificates: