sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #06638
Re: [Merge] ~cgrabowski/maas-ci/+git/system-tests:ha_postgres_system_tests into ~maas-committers/maas-ci/+git/system-tests:master
Diff comments:
> diff --git a/stubs/netaddr/ip/__init__.pyi b/stubs/netaddr/ip/__init__.pyi
> new file mode 100644
> index 0000000..034d875
> --- /dev/null
> +++ b/stubs/netaddr/ip/__init__.pyi
+1
> @@ -0,0 +1,23 @@
> +from __future__ import annotations
> +
> +from typing import Optional, Iterable
> +
> +
> +class IPNetwork:
> + broadcast: str
> + cidr: str
> + first: int
> + hostmask: str
> + ip: str
> + last: int
> + netmask: str
> + network: str
> + prefixlen: int
> + def __init__(
> + self,
> + addr: str,
> + implicit_prefix: Optional[bool] = ...,
> + version: Optional[int] = ...,
> + flags: Optional[Iterable[int]] = ...,
> + ) -> None: ...
> + def next(self, step: int = ...) -> IPNetwork: ...
> diff --git a/systemtests/chaos.py b/systemtests/chaos.py
> new file mode 100644
> index 0000000..ffec41a
> --- /dev/null
> +++ b/systemtests/chaos.py
> @@ -0,0 +1,19 @@
> +import random
> +from typing import List
+1
> +
> +from .ansible import AnsibleHost
> +from .lxd import Instance
> +
> +
> +class ChaosMixin:
> + def down_a_host(self, host: Instance) -> None:
> + host.stop(force=True)
> +
> + def down_random_host(self, hosts: List[Instance]) -> None:
> + target_host = random.choice(hosts)
> + self.down_a_host(target_host)
> +
> + def down_postgres_primary(self, ansible_hosts: List[AnsibleHost]) -> None:
> + for host in ansible_hosts:
> + if host.is_postgres_primary:
> + self.down_a_host(host.instance)
--
https://code.launchpad.net/~cgrabowski/maas-ci/+git/system-tests/+merge/438502
Your team MAAS Committers is subscribed to branch ~maas-committers/maas-ci/+git/system-tests:master.
References