|
25 | 25 | encoding="utf-8", |
26 | 26 | ) |
27 | 27 |
|
28 | | -BASE_CHANNEL_COUNT = 9 |
| 28 | +BASE_CHANNEL_COUNT = 11 # one alias |
29 | 29 | setup_compose = ComposeFixtureFactory(Path("docker") / Path("test-bash-ioc.yml")).return_fixture() |
30 | 30 |
|
31 | 31 |
|
@@ -126,3 +126,28 @@ def test_remove_channel(self, setup_compose: DockerCompose) -> None: # noqa: F8 |
126 | 126 | # Assert |
127 | 127 | check_channel_property(cf_client, name=base_channel_name) |
128 | 128 | check_channel_property(cf_client, name=base_channel_test_name, prop=INACTIVE_PROPERTY) |
| 129 | + |
| 130 | + |
| 131 | +class TestRemoveAlias: |
| 132 | + def test_remove_alias(self, setup_compose: DockerCompose) -> None: # noqa: F811 |
| 133 | + """ |
| 134 | + Test that removing an alias works correctly. |
| 135 | + """ |
| 136 | + # Arrange |
| 137 | + docker_ioc = start_ioc(setup_compose) |
| 138 | + LOG.info("Waiting for channels to sync") |
| 139 | + cf_client = create_client_and_wait(setup_compose, expected_channel_count=BASE_CHANNEL_COUNT) |
| 140 | + |
| 141 | + # Check before alias status |
| 142 | + LOG.debug('Checking ioc1-1 has ai:base_pv3 has an Active alias"') |
| 143 | + base_channel_name = "IOC1-1:ai:base_pv3:has_alias" |
| 144 | + check_channel_property(cf_client, name=base_channel_name) |
| 145 | + base_channel_alias_name = "IOC1-1:ai:base_pv3:alias" |
| 146 | + check_channel_property(cf_client, name=base_channel_alias_name) |
| 147 | + |
| 148 | + # Act |
| 149 | + restart_ioc(docker_ioc, cf_client, base_channel_name, "st_remove_alias") |
| 150 | + |
| 151 | + # Assert |
| 152 | + check_channel_property(cf_client, name=base_channel_name) |
| 153 | + check_channel_property(cf_client, name=base_channel_alias_name, prop=INACTIVE_PROPERTY) |
0 commit comments