Add cloudtaf framework
[ta/cloudtaf.git] / libraries / cluster / test_cluster.py
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from crl.interactivesessions.shells.sudoshell import BashShell
16 from .clusterverifier import CorruptedVerifier
17 from .cluster import Cluster
18 from . import cluster
19
20
21 def test_get_host(clusterverifier):
22     clusterverifier.verify_get_host()
23
24
25 def test_master_external_ip(clusterverifier):
26     clusterverifier.verify_master_external_ip()
27
28
29 def test_get_hosts_with_profile(clusterverifier):
30     clusterverifier.verify_get_hosts_with_profiles()
31
32
33 def test_get_hosts_containing(clusterverifier):
34     clusterverifier.verify_hosts_containing()
35
36
37 def test_cluster_caching(clusterverifier):
38     clusterverifier.verify_cluster_config_caching()
39
40
41 def test_cluster_singleton():
42     assert Cluster() == Cluster()
43
44
45 def test_cluster_mgmt_shelldicts(clusterverifier):
46     clusterverifier.verify_mgmt_shelldicts()
47
48
49 def test_get_host_raises(clustermocks):
50     c = CorruptedVerifier(clustermocks)
51     c.verify_corrupted_raises()
52
53
54 def test_create_remotesession(clusterverifier):
55     clusterverifier.verify_create_remotesession()
56
57
58 def test_initialize_remotesession(clusterverifier):
59     clusterverifier.verify_initialize_remotesession()
60
61
62 def test_create_hostcli(clusterverifier):
63     clusterverifier.verify_create_hostcli()
64
65
66 def test_initialize_hostcli(clusterverifier):
67     clusterverifier.verify_initialize_hostcli()
68
69
70 def test_create_user_with_roles(clusterverifier):
71     clusterverifier.verify_create_user_with_roles()
72
73
74 def test_delete_users(clusterverifier):
75     clusterverifier.verify_delete_users()
76
77
78 def test_envcreator_usage(clusterverifier):
79     clusterverifier.verify_envcreator()
80
81
82 def test_sudoshell_in_cluster():
83     assert cluster.BashShell == BashShell
84
85
86 def test_is_dpdk(clusterverifier):
87     clusterverifier.verify_is_dpdk()
88
89
90 def test_get_hosts_with_dpdk(clusterverifier):
91     clusterverifier.verify_get_hosts_with_dpdk()