forked from projectatomic/atomicapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_openshift_provider.py
48 lines (36 loc) · 1.27 KB
/
test_openshift_provider.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from __future__ import absolute_import
import logging
import os
from .base import OpenshiftProviderTestSuite
logger = logging.getLogger()
class TestWordpress(OpenshiftProviderTestSuite):
"""
Test Wordpress Atomic App on Kubernetes Provider
"""
def setUp(self):
super(TestWordpress, self).setUp()
self.answers.update({
'mariadb-atomicapp': {
'db_user': 'foo',
'db_pass': 'foo',
'db_name': 'foo'
},
'wordpress': {
'db_user': 'foo',
'db_pass': 'foo',
'db_name': 'foo'
}
})
def _run(self):
app_spec = os.path.join(
self.nulecule_lib, 'wordpress-centos7-atomicapp')
return self.deploy(app_spec, self.answers)
def test_wordpress_lifecycle(self):
workdir = self._run()
self.assertPod('wordpress', status='ContainerCreating', timeout=120)
self.assertPod('mariadb', status='Running', timeout=120)
self.assertService('wpfrontend', timeout=120)
self.assertService('mariadb', timeout=120)
self.undeploy(workdir)
self.assertPod('wordpress', exists=False, timeout=120)
self.assertPod('mariadb', exists=False, timeout=120)