1919 encoding = "utf-8" ,
2020)
2121
22- BASE_CHANNEL_COUNT = 9
22+ BASE_CHANNEL_COUNT = 11 # one alias
2323setup_compose = ComposeFixtureFactory (Path ("docker" ) / Path ("test-bash-ioc.yml" )).return_fixture ()
2424
2525
@@ -40,6 +40,7 @@ def stream_logs(exec_result, cmd: str):
4040 )
4141 log_thread .start ()
4242
43+
4344def start_ioc (setup_compose : DockerCompose ) -> Container :
4445 ioc_container = setup_compose .get_container ("ioc1-1" )
4546 docker_client = DockerClient ()
@@ -119,3 +120,28 @@ def test_remove_channel(self, setup_compose: DockerCompose) -> None: # noqa: F8
119120 # Assert
120121 check_channel_property (cf_client , name = base_channel_name )
121122 check_channel_property (cf_client , name = base_channel_test_name , prop = INACTIVE_PROPERTY )
123+
124+
125+ class TestRemoveAlias :
126+ def test_remove_alias (self , setup_compose : DockerCompose ) -> None : # noqa: F811
127+ """
128+ Test that removing an alias works correctly.
129+ """
130+ # Arrange
131+ docker_ioc = start_ioc (setup_compose )
132+ LOG .info ("Waiting for channels to sync" )
133+ cf_client = create_client_and_wait (setup_compose , expected_channel_count = BASE_CHANNEL_COUNT )
134+
135+ # Check before alias status
136+ LOG .debug ('Checking ioc1-1 has ai:base_pv3 has an Active alias"' )
137+ base_channel_name = "IOC1-1:ai:base_pv3:has_alias"
138+ check_channel_property (cf_client , name = base_channel_name )
139+ base_channel_alias_name = "IOC1-1:ai:base_pv3:alias"
140+ check_channel_property (cf_client , name = base_channel_alias_name )
141+
142+ # Act
143+ restart_ioc (docker_ioc , cf_client , base_channel_name , "st_remove_alias" )
144+
145+ # Assert
146+ check_channel_property (cf_client , name = base_channel_name )
147+ check_channel_property (cf_client , name = base_channel_alias_name , prop = INACTIVE_PROPERTY )
0 commit comments