Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
systemtests (python-bareos-test): add test test_login_tls_tls_fixedpr…
…otocolversion
  • Loading branch information
joergsteffens committed Dec 12, 2019
1 parent e1b7b12 commit 309379a
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion systemtests/tests/python-bareos-test/python-bareos-unittest.py
Expand Up @@ -445,7 +445,7 @@ def test_login_notls_tls(self):
self.assertFalse(hasattr(director.socket, 'cipher'))


def test_login_notls_tls_fixprotocolversion(self):
def test_login_notls_tls_fixedprotocolversion(self):
'''
console: notls, director: tls => nologin
Expand Down Expand Up @@ -523,6 +523,34 @@ def test_login_tls_tls(self):
logger.debug(str(cipher))


@unittest.skipUnless(bareos.bsock.DirectorConsole.is_tls_psk_available(),
"TLS-PSK is not available.")
def test_login_tls_tls_fixedprotocolversion(self):
'''
console: tls, director: tls => login
'''

logger = logging.getLogger()

username = self.get_operator_username(tls=True)
password = self.get_operator_password(username)

director = bareos.bsock.DirectorConsole(
address=self.director_address,
port=self.director_port,
protocolversion=ProtocolVersions.last,
tls_psk_require=True,
name=username,
password=password)

whoami = director.call('whoami').decode('utf-8')
self.assertEqual(username, whoami.rstrip())

self.assertTrue(hasattr(director.socket, 'cipher'))
cipher = director.socket.cipher()
logger.debug(str(cipher))



#
# Test with JSON backend
Expand Down

0 comments on commit 309379a

Please sign in to comment.