(cls)
| 397 | class TestGssAuthentication(BaseTestAuthentication): |
| 398 | @classmethod |
| 399 | def setUpClass(cls): |
| 400 | try: |
| 401 | from k5test.realm import K5Realm |
| 402 | except ModuleNotFoundError: |
| 403 | raise unittest.SkipTest('k5test not installed') |
| 404 | |
| 405 | cls.realm = K5Realm() |
| 406 | cls.addClassCleanup(cls.realm.stop) |
| 407 | # Setup environment before starting the cluster. |
| 408 | patch = unittest.mock.patch.dict(os.environ, cls.realm.env) |
| 409 | patch.start() |
| 410 | cls.addClassCleanup(patch.stop) |
| 411 | # Add credentials. |
| 412 | cls.realm.addprinc('postgres/localhost') |
| 413 | cls.realm.extract_keytab('postgres/localhost', cls.realm.keytab) |
| 414 | |
| 415 | cls.USERS = [ |
| 416 | (cls.realm.user_princ, 'gss', None), |
| 417 | (f'wrong-{cls.realm.user_princ}', 'gss', None), |
| 418 | ] |
| 419 | super().setUpClass() |
| 420 | |
| 421 | cls.cluster.override_connection_spec(host='localhost') |
| 422 | |
| 423 | @classmethod |
| 424 | def get_server_settings(cls): |
no test coverage detected