Re: [Sts-sponsors] [Merge] ~adam-collard/maas-ci/+git/system-tests:lxd-logger-name into ~maas-committers/maas-ci/+git/system-tests:master

2023-01-11 Thread Diego Mascialino
Review: Approve

nice! there will be easier to follow logs
-- 
https://code.launchpad.net/~adam-collard/maas-ci/+git/system-tests/+merge/435598
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~ack/maas-ci/+git/system-tests:vault-log into ~maas-committers/maas-ci/+git/system-tests:master

2023-01-05 Thread Diego Mascialino
Review: Approve


-- 
https://code.launchpad.net/~ack/maas-ci/+git/system-tests/+merge/435208
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~adam-collard/maas-ci/+git/system-tests:extract-setup-vault-tls into ~maas-committers/maas-ci/+git/system-tests:master

2023-01-03 Thread Diego Mascialino
Review: Approve

Nice refactor!
-- 
https://code.launchpad.net/~adam-collard/maas-ci/+git/system-tests/+merge/435078
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~cgrabowski/maas:fix_config_permissions_on_init into maas:master

2022-12-13 Thread Diego Mascialino
just checking:

did you check these other changes to permissions of /etc/maas* ?


$ git grep "chown.*etc/maas"

debian/maas-common.postinst:chown -R maas:maas /etc/maas/certificates
utilities/remote-reinstall:ssh_run "chown -R maas:maas /etc/maas"

-- 
https://code.launchpad.net/~cgrabowski/maas/+git/maas/+merge/434600
Your team MAAS Maintainers is requested to review the proposed merge of 
~cgrabowski/maas:fix_config_permissions_on_init into maas:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~adam-collard/maas-ci/+git/maas-ci-config:filter-envs-output-file into ~maas-committers/maas-ci/+git/maas-ci-config:master

2022-12-13 Thread Diego Mascialino
Review: Approve


-- 
https://code.launchpad.net/~adam-collard/maas-ci/+git/maas-ci-config/+merge/434567
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/maas-ci-config:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~adam-collard/maas-ci/+git/system-tests:tox-4.0 into ~maas-committers/maas-ci/+git/system-tests:master

2022-12-12 Thread Diego Mascialino
Review: Approve


-- 
https://code.launchpad.net/~adam-collard/maas-ci/+git/system-tests/+merge/434506
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~adam-collard/maas-ci/+git/maas-ci-config:tls-sync into ~maas-committers/maas-ci/+git/maas-ci-config:master

2022-12-12 Thread Diego Mascialino
Review: Approve


-- 
https://code.launchpad.net/~adam-collard/maas-ci/+git/maas-ci-config/+merge/434493
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/maas-ci-config:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~maas-committers/maas-ci/+git/system-tests:ansible-tests into ~maas-committers/maas-ci/+git/system-tests:master

2022-12-06 Thread Diego Mascialino



Diff comments:

> diff --git a/systemtests/region.py b/systemtests/region.py
> index a6ef1bf..c17a6b2 100644
> --- a/systemtests/region.py
> +++ b/systemtests/region.py
> @@ -64,6 +66,27 @@ class MAASRegion:
>  ]
>  )
>  
> +def login_user(self, user: str) -> None:

Right, currently we are not using the MAAS client in the same container as MAAS.
We have a the `authenticated_admin` fixture, it requires to have a 
credentials.yaml file, it should be written after the MAAS installation with 
the admin credentials. (see 
https://git.launchpad.net/~maas-committers/maas-ci/+git/system-tests/tree/systemtests/fixtures.py#n538
 )

> +self.execute(
> +[
> +"maas",
> +"login",
> +user,
> +f"{self.url}/api/2.0/",
> +self.get_api_token(user),
> +]
> +)
> +
> +def get_version(self) -> str:
> +if not self.user_exists(ADMIN_USER):
> +self.create_user(ADMIN_USER, ADMIN_PASSWORD, ADMIN_EMAIL)
> +self.login_user(ADMIN_USER)
> +v_info = json.loads(
> +self.execute(["maas", ADMIN_USER, "version", "read"]).stdout
> +)
> +LOG.info(v_info)
> +return str(v_info.get("version", "0.0.0"))
> +
>  def get_proxy_settings(self, config: dict[str, Any]) -> dict[str, 
> Union[bool, str]]:
>  proxy_config = config.get("proxy", {})
>  http_proxy = proxy_config.get("http", "")


-- 
https://code.launchpad.net/~maas-committers/maas-ci/+git/system-tests/+merge/433880
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~maas-committers/maas-ci/+git/system-tests:ansible-tests into ~maas-committers/maas-ci/+git/system-tests:master

2022-12-06 Thread Diego Mascialino
Review: Needs Fixing



Diff comments:

> diff --git a/README.md b/README.md
> index 2a998fc..52e2d75 100644
> --- a/README.md
> +++ b/README.md
> @@ -50,7 +50,11 @@ for init in inits:
>   docstring = textwrap.fill(module.__doc__, 80)
>   cog.outl(f" - `{package}`: {docstring}\n")
>  ]]] -->
> -We have 4 test suites:
> +We have 5 test suites:
> + - `ansible_tests`:  Prepares a container running ansible, and clones 
> maas/maas-ansible-playbooks,

I am not sure if we want a different test suite for Ansible.
I prefer to use the same "env_builder" test suite, and if Ansible is configured 
for this test execution then build environment with ansible (similar about how 
we currently install MAAS from snap or deb).
Because if we have a different test suite we will need also different Jenkins 
job definitions and not only a different configuration.

> +to test their MAAS topolgy is configurable with Ansible, and that the MAAS
> +install behaves as expected under testing.
> +
>   - `collect_sos_report`: Collect an SOS report from the test run.
>  
>   - `env_builder`:  Prepares a container with a running MAAS ready to run the 
> tests, and writes a
> diff --git a/systemtests/ansible.py b/systemtests/ansible.py
> new file mode 100644
> index 000..ff2db89
> --- /dev/null
> +++ b/systemtests/ansible.py
> @@ -0,0 +1,437 @@
> +from __future__ import annotations
> +
> +import re
> +import warnings
> +from contextlib import contextmanager
> +from logging import getLogger
> +from typing import Generator
> +
> +from .lxd import get_lxd
> +from .region import MAASRegion
> +
> +NAME = "systemtests.ansible"
> +LOG = getLogger(NAME)
> +empty_dict = {"None": "None"}
> +
> +
> +class MissingRoleOnHost(Exception):
> +"""Raised when a host is missing a role they were expected to have."""
> +
> +pass
> +
> +
> +class HostWithoutRole(Warning):
> +"""Raised when a host does not have any assigned roles."""
> +
> +pass
> +
> +
> +class HostWithoutRegion(MissingRoleOnHost):
> +"""Raised when a host attempts to access a region when
> +it does not yet have one installed."""
> +
> +pass
> +
> +
> +class CommandExecutaionFailed(Exception):
> +"""Raised when the try_execute failed"""
> +
> +pass
> +
> +
> +class AnsibleShared:
> +config: dict[str, str] = {}
> +lxd = get_lxd(LOG)
> +name: str = "ansible-shared"
> +roles: dict[str, dict[str, str]] = {}
> +
> +def __init__(self, user: str = "ubuntu") -> None:
> +self.base_filepath = f"/home/{user}"
> +self.host_file = f"{self.base_filepath}/hosts"
> +self.user = user
> +
> +def __repr__(self) -> str:
> +return f"<{self.__class__.__name__} in container {self.name}"
> +
> +def apt_install(self, module: str) -> None:
> +if self.has_container:
> +self.execute(["apt-get", "update", "-y"])
> +self.execute(["dpkg", "--configure", "-a"])
> +self.execute(["apt", "install", module, "-y"])
> +
> +def module_exists(self, module: str) -> bool:
> +if self.has_container:
> +return bool(self.quietly_execute(["pip3", "list", "|", "grep", 
> module]))
> +return False
> +
> +def pip_install(self, module: str) -> None:
> +if self.has_container:
> +if not self.module_exists(module):
> +self.execute(["pip3", "install", module, "-y"])
> +else:
> +self.execute(["pip3", "install", module, "--upgrade"])
> +
> +@property
> +def has_container(self) -> bool:
> +return self.lxd.container_exists(self.name)
> +
> +@property
> +def ip(self) -> str:
> +if self.has_container:
> +return self.lxd.get_ip_address(self.name)
> +return "127.0.0.1"
> +
> +def restart(self) -> None:
> +self.lxd.restart(self.name, True)
> +
> +def execute(self, command: list[str]) -> str:
> +if isinstance(command, str):
> +command = command.split(" ")
> +return self.lxd.execute(self.name, command).stdout
> +
> +def try_execute(self, command: list[str]) -> str:
> +try:
> +return self.execute(command)
> +except Exception as exception:
> +LOG.warning(exception)
> +return str(exception)
> +
> +def quietly_execute(self, command: list[str]) -> str:
> +return self.lxd.quietly_execute(self.name, command).stdout
> +
> +def absolute_file_path(self, file_path: str) -> str:
> +if file_path[0] == "~":
> +file_path = f"{self.base_filepath}{file_path[1:]}"
> +return file_path
> +
> +def abs_fp(self, file_path: str) -> str:
> +return self.absolute_file_path(file_path)
> +
> +def file_exists(self, file_path: str) -> bool:
> +return self.lxd.file_exists(self.name, 
> self.absolute_file_path(file_path))
> +
> +def get_file_contents(self, file_path: str) -> str:
> +if file_path[0] == "~":
> +

Re: [Sts-sponsors] [Merge] ~cgrabowski/maas-ci/+git/maas-ci-internal:fix_terraform_cleanup into ~maas-committers/maas-ci/+git/maas-ci-internal:main

2022-11-29 Thread Diego Mascialino
Review: Approve

+1
-- 
https://code.launchpad.net/~cgrabowski/maas-ci/+git/maas-ci-internal/+merge/433758
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/maas-ci-internal:main.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:update_o11y_setup into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-29 Thread Diego Mascialino
The proposal to merge ~dmascialino/maas-ci/+git/system-tests:update_o11y_setup 
into ~maas-committers/maas-ci/+git/system-tests:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433801
-- 
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:update_o11y_setup into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-29 Thread Diego Mascialino
Diego Mascialino has proposed merging 
~dmascialino/maas-ci/+git/system-tests:update_o11y_setup into 
~maas-committers/maas-ci/+git/system-tests:master.

Commit message:
Update o11y systemd unit.

Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433801
-- 
Your team MAAS Committers is requested to review the proposed merge of 
~dmascialino/maas-ci/+git/system-tests:update_o11y_setup into 
~maas-committers/maas-ci/+git/system-tests:master.
diff --git a/systemtests/fixtures.py b/systemtests/fixtures.py
index 033fa08..4e5610c 100644
--- a/systemtests/fixtures.py
+++ b/systemtests/fixtures.py
@@ -129,6 +129,9 @@ def maas_deb_repo(
 build_container, ["git", "-C", "maas", "checkout", maas_git_branch]
 )
 lxd.execute(
+build_container, ["git", "config", "--global", "core.abbrev", "9"]
+)
+lxd.execute(
 build_container,
 [
 "mk-build-deps",
@@ -573,7 +576,8 @@ def maas_region(
 -E MAAS_AZ="default" \
 {AGENT_PATH} \
 -config.expand-env \
--config.file=/opt/agent/agent.yml
+-config.file=/opt/agent/agent.yml \
+-server.http.address="0.0.0.0:3100" -server.grpc.address="0.0.0.0:9095"
 """
 )
 lxd.execute(maas_container, ["sh", "-c", telemetry_run_cmd])
-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-29 Thread Diego Mascialino
The proposal to merge ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa 
into ~maas-committers/maas-ci/+git/system-tests:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433798
-- 
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-29 Thread Diego Mascialino
Diego Mascialino has proposed merging 
~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into 
~maas-committers/maas-ci/+git/system-tests:master.

Commit message:
Allow list of PPAs



Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433798

Our utils/gen_config.py generates a list of PPAs.

This MP fixes system-tests code to use it correctly.
-- 
Your team MAAS Committers is requested to review the proposed merge of 
~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into 
~maas-committers/maas-ci/+git/system-tests:master.
diff --git a/config.yaml.sample b/config.yaml.sample
index 991b6cb..e9648fe 100644
--- a/config.yaml.sample
+++ b/config.yaml.sample
@@ -87,7 +87,8 @@ machines:
 -END PRIVATE KEY-
 
 deb:
-ppa: ppa:maas-committers/latest-deps
+ppa:
+- ppa:maas-committers/latest-deps
 git_repo: https://git.launchpad.net/maas
 git_branch: master
 
diff --git a/systemtests/fixtures.py b/systemtests/fixtures.py
index 033fa08..63e9baf 100644
--- a/systemtests/fixtures.py
+++ b/systemtests/fixtures.py
@@ -28,12 +28,13 @@ LXD_PROFILE = os.environ.get("MAAS_SYSTEMTESTS_LXD_PROFILE", "prof-maas-lab")
 
 def _add_maas_ppa(lxd: CLILXD, container: str, config: dict[str, Any]) -> None:
 """Add MAAS PPA to the given container."""
-MAAS_PPA = config.get("deb", {}).get("ppa", "ppa:maas-committers/latest-deps")
-lxd.execute(
-container,
-["add-apt-repository", "-y", MAAS_PPA],
-environment={"DEBIAN_FRONTEND": "noninteractive"},
-)
+MAAS_PPA = config.get("deb", {}).get("ppa", ["ppa:maas-committers/latest-deps"])
+for ppa in MAAS_PPA:
+lxd.execute(
+container,
+["add-apt-repository", "-y", ppa],
+environment={"DEBIAN_FRONTEND": "noninteractive"},
+)
 
 
 @pytest.fixture(scope="session")
-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into maas-ci:maas-submodules-sync

2022-11-29 Thread Diego Mascialino
The proposal to merge ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa 
into maas-ci:maas-submodules-sync has been updated.

Status: Needs review => Rejected

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433752
-- 
Your team MAAS Committers is requested to review the proposed merge of 
~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into 
maas-ci:maas-submodules-sync.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into maas-ci:maas-submodules-sync

2022-11-28 Thread Diego Mascialino
The proposal to merge ~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa 
into maas-ci:maas-submodules-sync has been updated.

Description changed to:

Our utils/gen_config.py generates a list of PPAs.

This MP fixes system-tests code to use it correctly.

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433752
-- 
Your team MAAS Committers is requested to review the proposed merge of 
~dmascialino/maas-ci/+git/system-tests:allow_list_of_ppa into 
maas-ci:maas-submodules-sync.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/maas-ci-config:systemtests_with_gen_config into ~maas-committers/maas-ci/+git/maas-ci-config:master

2022-11-25 Thread Diego Mascialino
The proposal to merge 
~dmascialino/maas-ci/+git/maas-ci-config:systemtests_with_gen_config into 
~maas-committers/maas-ci/+git/maas-ci-config:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/maas-ci-config/+merge/429707
-- 
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/maas-ci-config:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:write_version_under_test into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-23 Thread Diego Mascialino
The proposal to merge 
~dmascialino/maas-ci/+git/system-tests:write_version_under_test into 
~maas-committers/maas-ci/+git/system-tests:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433550
-- 
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/system-tests:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


[Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/system-tests:write_version_under_test into ~maas-committers/maas-ci/+git/system-tests:master

2022-11-23 Thread Diego Mascialino
Diego Mascialino has proposed merging 
~dmascialino/maas-ci/+git/system-tests:write_version_under_test into 
~maas-committers/maas-ci/+git/system-tests:master.

Commit message:
Write version_under_test file

Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~dmascialino/maas-ci/+git/system-tests/+merge/433550

This will be useful to adding a description in each system-tests Jenkins job 
execution.
-- 
Your team MAAS Committers is requested to review the proposed merge of 
~dmascialino/maas-ci/+git/system-tests:write_version_under_test into 
~maas-committers/maas-ci/+git/system-tests:master.
diff --git a/systemtests/fixtures.py b/systemtests/fixtures.py
index d1df6e9..033fa08 100644
--- a/systemtests/fixtures.py
+++ b/systemtests/fixtures.py
@@ -386,9 +386,13 @@ def maas_region(
 maas_already_initialized = lxd.file_exists(
 maas_container, "/var/snap/maas/common/snap_mode"
 )
-lxd.execute(
+snap_list = lxd.execute(
 maas_container, ["snap", "list", "maas"]
 )  # just to record which version is running.
+try:
+version = snap_list.stdout.split("\n")[1].split()[1]
+except IndexError:
+version = ""
 if not maas_already_initialized:
 lxd.execute(
 maas_container,
@@ -419,11 +423,15 @@ def maas_region(
 ["apt", "install", "--yes", "maas"],
 environment={"DEBIAN_FRONTEND": "noninteractive"},
 )
-lxd.execute(
+policy = lxd.execute(
 maas_container,
 ["apt-cache", "policy", "maas"],
 environment={"DEBIAN_FRONTEND": "noninteractive"},
 )  # just to record which version is running.
+try:
+version = policy.stdout.split("\n")[1].strip().split(" ")[1][2:]
+except IndexError:
+version = ""
 
 if vault:
 maas_vault_status = yaml.safe_load(
@@ -529,6 +537,9 @@ def maas_region(
 credentials["snap_channel"] = config["snap"]["maas_channel"]
 yaml.dump(credentials, fh)
 
+with open("version_under_test", "w") as fh:
+fh.write(f"{version}\n")
+
 if o11y := config.get("o11y"):
 AGENT_PATH = "/opt/agent/agent-linux-amd64"
 if not lxd.file_exists(maas_container, AGENT_PATH):
-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp


Re: [Sts-sponsors] [Merge] ~dmascialino/maas-ci/+git/maas-ci-config:systemtests_with_gen_config into ~maas-committers/maas-ci/+git/maas-ci-config:master

2022-11-18 Thread Diego Mascialino
@ack: thanks for your review, I removed http_proxy config from the pipeline 
env, and set it into the Node env vars.

Also I modified the way both sets of tests are executed, in order to always 
execute all the tests (and not finish early when some machines in ENVS1 fails).
-- 
https://code.launchpad.net/~dmascialino/maas-ci/+git/maas-ci-config/+merge/429707
Your team MAAS Committers is subscribed to branch 
~maas-committers/maas-ci/+git/maas-ci-config:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to : sts-sponsors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp