test/builder: check ssl_verify can be a string

The ssl_verify config option can be a string, i.e. a path to the
certificate authority for the server side certificate. Check
that we handle that properly.
This commit is contained in:
Christian Kellner 2020-09-16 18:14:47 +02:00
parent bae564a1ab
commit 94f7b35967

View file

@ -190,6 +190,21 @@ class TestBuilderPlugin(PluginTest):
self.assertEqual(session.cert, certs)
self.assertEqual(session.verify, ssl_verify)
# check we can handle a path in ssl_verify
ssl_verify = "/a/path/to/a/ca"
cfg["composer"]["ssl_verify"] = ssl_verify
cfgfile = os.path.abspath(os.path.join(tmp, "ko.cfg"))
with open(cfgfile, 'w') as f:
cfg.write(f)
handler = self.plugin.OSBuildImage(1,
"osbuildImage",
"params",
session,
options)
session = handler.client.http
self.assertEqual(session.verify, ssl_verify)
def test_unknown_build_target(self):
session = flexmock()