1
1
import pytest
2
2
from settings import TEST_DATA
3
- from suite .utils .custom_assertions import assert_event
4
- from suite .utils .custom_resources_utils import is_dnsendpoint_present
3
+ from suite .utils .custom_assertions import assert_event , assert_event_not_present
4
+ from suite .utils .custom_resources_utils import is_dnsendpoint_present , read_custom_resource
5
5
from suite .utils .resources_utils import get_events , patch_namespace_with_label , wait_before_test
6
6
from suite .utils .vs_vsr_resources_utils import patch_virtual_server_from_yaml
7
7
from suite .utils .yaml_utils import get_name_from_yaml , get_namespace_from_yaml
@@ -48,6 +48,21 @@ def test_responses_after_setup(
48
48
wait_before_test (1 )
49
49
print (f"External DNS not updated, retrying... #{ retry } " )
50
50
assert wanted_string in log_contents
51
+ print ("\n Step 3: Verify VS status is Valid and no bad config events occurred" )
52
+ events = get_events (kube_apis .v1 , virtual_server_setup .namespace )
53
+ vs_bad_config_event = "Error creating DNSEndpoint for VirtualServer resource"
54
+ assert_event_not_present (vs_bad_config_event , events )
55
+ response = read_custom_resource (
56
+ kube_apis .custom_objects ,
57
+ virtual_server_setup .namespace ,
58
+ "virtualservers" ,
59
+ virtual_server_setup .vs_name ,
60
+ )
61
+ assert (
62
+ response ["status" ]
63
+ and response ["status" ]["reason" ] == "AddedOrUpdated"
64
+ and response ["status" ]["state" ] == "Valid"
65
+ )
51
66
52
67
def test_update_to_ed_in_vs (
53
68
self , kube_apis , crd_ingress_controller_with_ed , create_externaldns , virtual_server_setup
@@ -65,6 +80,18 @@ def test_update_to_ed_in_vs(
65
80
wait_before_test (5 )
66
81
events = get_events (kube_apis .v1 , virtual_server_setup .namespace )
67
82
assert_event (vs_event_update_text , events )
83
+ print ("\n Step 3: Verify VS status is Valid" )
84
+ response = read_custom_resource (
85
+ kube_apis .custom_objects ,
86
+ virtual_server_setup .namespace ,
87
+ "virtualservers" ,
88
+ virtual_server_setup .vs_name ,
89
+ )
90
+ assert (
91
+ response ["status" ]
92
+ and response ["status" ]["reason" ] == "AddedOrUpdated"
93
+ and response ["status" ]["state" ] == "Valid"
94
+ )
68
95
69
96
70
97
@pytest .mark .vs
@@ -122,3 +149,18 @@ def test_responses_after_setup(
122
149
wait_before_test (1 )
123
150
print (f"External DNS not updated, retrying... #{ retry } " )
124
151
assert wanted_string in log_contents
152
+ print ("\n Step 3: Verify VS status is Valid and no bad config events occurred" )
153
+ events = get_events (kube_apis .v1 , virtual_server_setup .namespace )
154
+ vs_bad_config_event = "Error creating DNSEndpoint for VirtualServer resource"
155
+ assert_event_not_present (vs_bad_config_event , events )
156
+ response = read_custom_resource (
157
+ kube_apis .custom_objects ,
158
+ virtual_server_setup .namespace ,
159
+ "virtualservers" ,
160
+ virtual_server_setup .vs_name ,
161
+ )
162
+ assert (
163
+ response ["status" ]
164
+ and response ["status" ]["reason" ] == "AddedOrUpdated"
165
+ and response ["status" ]["state" ] == "Valid"
166
+ )
0 commit comments