Project

General

Profile

Actions

action #156169

closed

Automatically validate openQA AutoYaST profile ay-openqa-worker.xml.erb size:S

Added by ybonatakis 9 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2024-02-27
Due date:
2024-08-28
% Done:

0%

Estimated time:

Description

Motivation

https://github.com/os-autoinst/openQA/blob/master/contrib/ay-openqa-worker.xml.erb is used for openqa workers.
This is passed as-is to autoyast and seems to work.
But when we generate the xml manual

  • Either TW or Leap
  • install autoyast2
  • Run sudo yast2 autoyast check-profile filename=ay-openqa-worker.xml.erb output=result.xml run-scripts=true run-erb=true

Then complains for:

  • firewall configuration
  • failure to run the scripts

I am not sure about the requirements about the later, but firewall should be easy to address.

Acceptance criteria

  • AC1: Automatic CI tests verify the validity of the autoyast profile generated by the template file
  • AC2: A manual verification by installing in a virtual machine with the generated profile.

Suggestions

  • Implement an openQA test that verifies the profile
  • Or an openSUSE container running the yast2 call? Consider github actions triggered by changes to the file or only in master
  • Document how to use the profile and ensure only a working profile is documented

Files


Related issues 1 (0 open1 closed)

Related to openQA Project - action #155305: Ensure our commonly used openQA installation autoyast profile covers chronyd size:MResolvedybonatakis2024-02-27

Actions
Actions #1

Updated by okurz 9 months ago

  • Target version set to Tools - Next
Actions #2

Updated by okurz 9 months ago

  • Subject changed from Validate ay-openqa-worker.xml.erb to Automatically validate ay-openqa-worker.xml.erb
  • Parent task deleted (#155305)
Actions #3

Updated by okurz 9 months ago

  • Related to action #155305: Ensure our commonly used openQA installation autoyast profile covers chronyd size:M added
Actions #4

Updated by okurz 7 months ago

  • Subject changed from Automatically validate ay-openqa-worker.xml.erb to Automatically validate openQA AutoYaST profile ay-openqa-worker.xml.erb size:S
  • Description updated (diff)
Actions #5

Updated by okurz 7 months ago

  • Status changed from New to Workable
Actions #6

Updated by okurz 3 months ago

  • Target version changed from Tools - Next to Ready
Actions #7

Updated by ybonatakis 3 months ago

  • Status changed from Workable to In Progress
  • Assignee set to ybonatakis
Actions #8

Updated by ybonatakis 3 months ago

firewall complain comes from https://github.com/os-autoinst/openQA/blob/master/contrib/ay-openqa-worker.xml.erb#L101

<FW_CONFIGURATIONS_EXT>sshd</FW_CONFIGURATIONS_EXT>

failure to run the scripts is due to run-scripts=true in the check-profile and makes sense I think locally. But I guess it shouldnt happen in the worker, right?

Actions #10

Updated by ybonatakis 3 months ago · Edited

https://github.com/os-autoinst/openQA/pull/5839 addressing the firewall warning

However the automation and validation of erb is kinda tricky and with some challenges.
I talk to ancorgs who told me that it's more like evaluating a C or C++ code than a static XML
and

validation of ERB will be always tricky, e.g. if there is an "if" condition then you will always validate only one branch, you would need to run it once more with settings or environment where it evaluates the second branch

So far I am struggling with find the proper container. Different container different issue

  • registry.opensuse.org/devel/openqa/ci/containers/base:latest is not multi-user system
  • registry.opensuse.org/devel/openqa/containers/tumbleweed:client
  • registry.opensuse.org/opensuse/tumbleweed:latest is hanging
  • registry.opensuse.org/opensuse/leap:latest Target multi-user not found
  • registry.opensuse.org/yast/sle-15/sp6/images/opensuse/leap:15.6 Target multi-user not found
Actions #11

Updated by openqa_review 3 months ago

  • Due date set to 2024-08-23

Setting due date based on mean cycle time of SUSE QE Tools

Actions #12

Updated by ybonatakis 3 months ago

  • Due date deleted (2024-08-23)
  • Status changed from In Progress to Blocked

Actually registry.opensuse.org/opensuse/tumbleweed:latest seems to work. But the UI when it finds an error or at the end throws some popups which prevent automation.

I sent an email to yast-devel@opensuse.org in order to get some help in the problem and get some insights.

Actions #13

Updated by okurz 3 months ago

For testing based on a virtual machine installed by the autoyast profile I can also recommend to try https://github.com/okurz/scripts/blob/master/vm

Actions #14

Updated by livdywan 3 months ago

  • Status changed from Blocked to Feedback

okurz wrote in #note-13:

For testing based on a virtual machine installed by the autoyast profile I can also recommend to try https://github.com/okurz/scripts/blob/master/vm

Just to be sure we are on the same page. AC1 says Automatic CI tests. The suggestions include an openQA test or a workflow on GitHub. A one-off is not enough for this ticket.

Actions #15

Updated by livdywan 3 months ago

Just to be sure we are on the same page. AC1 says Automatic CI tests. The suggestions include an openQA test or a workflow on GitHub. A one-off is not enough for this ticket.

Existing tests work by setting AUTOYAST, for instance https://openqa.opensuse.org/tests/4396756 - see lib/autoyast.pm for the implementation details. Maybe we can simply add a new test based on that?

Actions #16

Updated by ybonatakis 3 months ago · Edited

livdywan wrote in #note-15:

Just to be sure we are on the same page. AC1 says Automatic CI tests. The suggestions include an openQA test or a workflow on GitHub. A one-off is not enough for this ticket.

Existing tests work by setting AUTOYAST, for instance https://openqa.opensuse.org/tests/4396756 - see lib/autoyast.pm for the implementation details. Maybe we can simply add a new test based on that?

As I see I have to reinvent the whole autoyast.pm right? What do you mean by implementation details?
If we follow the openqa implementation this is not anymore an easy ticket. I think also it is my first time touching this repo.

Actions #17

Updated by okurz 3 months ago

ybonatakis wrote in #note-16:

livdywan wrote in #note-15:

Just to be sure we are on the same page. AC1 says Automatic CI tests. The suggestions include an openQA test or a workflow on GitHub. A one-off is not enough for this ticket.

A one-off is not enough but could help to understand what's necessary. And while it's suggested to use an "openQA test" that does not mean that a full autoyast based installation should be done.

Existing tests work by setting AUTOYAST, for instance https://openqa.opensuse.org/tests/4396756 - see lib/autoyast.pm for the implementation details. Maybe we can simply add a new test based on that?

As I see I have to reinvent the whole autoyast.pm right? What do you mean by implementation details?

I think having an automatic installation test based on the autoyast profile would be helpful but likely it would also take quite some time to conduct so is likely not feasible to include in CI tests running on every PR. That would be something for "post-master" merge. But please don't consider reinventing osado tests.

I suggest to do the automatic validation within an openQA tests, so e.g. install yast and call yast2 autoyast check-profile …. Do not conduct a full installation within an openQA test. Only do a manual verification by installing in a virtual machine once.

If we follow the openqa implementation this is not anymore an easy ticket.

Nobody ever said it would easy, right? :)

Actions #18

Updated by ybonatakis 3 months ago

  • Status changed from Feedback to In Progress

okurz wrote in #note-17:

ybonatakis wrote in #note-16:

livdywan wrote in #note-15:

Just to be sure we are on the same page. AC1 says Automatic CI tests. The suggestions include an openQA test or a workflow on GitHub. A one-off is not enough for this ticket.

A one-off is not enough but could help to understand what's necessary. And while it's suggested to use an "openQA test" that does not mean that a full autoyast based installation should be done.

Existing tests work by setting AUTOYAST, for instance https://openqa.opensuse.org/tests/4396756 - see lib/autoyast.pm for the implementation details. Maybe we can simply add a new test based on that?

As I see I have to reinvent the whole autoyast.pm right? What do you mean by implementation details?

I think having an automatic installation test based on the autoyast profile would be helpful but likely it would also take quite some time to conduct so is likely not feasible to include in CI tests running on every PR. That would be something for "post-master" merge. But please don't consider reinventing osado tests.

I suggest to do the automatic validation within an openQA tests, so e.g. install yast and call yast2 autoyast check-profile …. Do not conduct a full installation within an openQA test. Only do a manual verification by installing in a virtual machine once.

This simplifies things.

If we follow the openqa implementation this is not anymore an easy ticket.

Nobody ever said it would easy, right? :)

Actions #19

Updated by openqa_review 3 months ago

  • Due date set to 2024-08-28

Setting due date based on mean cycle time of SUSE QE Tools

Actions #20

Updated by ybonatakis 3 months ago

I created https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/198 but it is not ready.
Locally the test fails to match the screen, even I have created from the UI. But I think because of the git url ref to the needles, the needle cannot be found.

Actions #21

Updated by ybonatakis 3 months ago

  • Description updated (diff)
Actions #23

Updated by ybonatakis 3 months ago

installation at least finished successfully

I dont know creds to login tho

Actions #24

Updated by okurz 3 months ago

ybonatakis wrote in #note-23:

installation at least finished successfully

I dont know creds to login tho

Did you set a password then? See
https://progress.opensuse.org/projects/openqav3/wiki/#Network-legacy-boot-via-PXE-and-OSworker-setup
which mentions the console parameter for installation rootpassword=<password_to_login_as_root>

Actions #25

Updated by livdywan 3 months ago

ybonatakis wrote in #note-22:

https://github.com/os-autoinst/os-autoinst-needles-openQA/pull/25 needles added
https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/198 is also updated

As discussed please try and provide a verification run on o3 that uses the new needles

Actions #26

Updated by ybonatakis 3 months ago

okurz wrote in #note-24:

ybonatakis wrote in #note-23:

installation at least finished successfully

...

I dont know creds to login tho

Did you set a password then? See
https://progress.opensuse.org/projects/openqav3/wiki/#Network-legacy-boot-via-PXE-and-OSworker-setup
which mentions the console parameter for installation rootpassword=<password_to_login_as_root>

I reinstalled the system with the system boots. Some things which are in inconsistency with the autoyast profile

  • firewalld is not installed and as such not configured
  • ip_forwarding doesnt seem enabled

So I can add the firewalld in the template but I would like a confirmation first

Actions #27

Updated by livdywan 3 months ago

https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/198 merged. Open question:

Should we also schedule this test regularly? Or do you want to do this in a followup PR?

We definitely need this to run regularly to fulfill AC1.

Actions #28

Updated by ybonatakis 3 months ago

livdywan wrote in #note-27:

https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/198 merged. Open question:

Should we also schedule this test regularly? Or do you want to do this in a followup PR?

We definitely need this to run regularly to fulfill AC1.

I did this already, right? https://progress.opensuse.org/issues/156169#note-26

Actions #29

Updated by livdywan 3 months ago

Validation run with the fixed profile https://openqa.opensuse.org/tests/4415391 from https://github.com/os-autoinst/openQA/pull/5839#pullrequestreview-2260181851

  • One more review needed
  • Schedule to be added
Actions #30

Updated by ybonatakis 3 months ago · Edited

Actions #31

Updated by ybonatakis 3 months ago

  • Status changed from Feedback to Resolved

job run successful in O3

Actions #32

Updated by livdywan 3 months ago

ybonatakis wrote in #note-31:

job run successful in O3

https://openqa.opensuse.org/tests/4436591

Actions

Also available in: Atom PDF