Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration tests: invalid bluechi agent port #482

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

dougsland
Copy link
Contributor

@dougsland dougsland commented Aug 19, 2023

This test includes three nodes: bluechi-controller, node-foo, node-bar.

  • bluechi-controller is the controller node
  • node-foo will start the agent service with normal configuration using port 8420
  • node-bar will try to start the agent service with incorrect port (842O) and should fail (as expected)

Related: #416

Signed-off-by: Douglas Schilling Landgraf [email protected]

@dougsland
Copy link
Contributor Author

I will send more patches to complete #416. One test per file to simplify the code/review/test. We should cover all agent/controller options.

@dougsland
Copy link
Contributor Author

dougsland commented Aug 19, 2023

Funny to see that even with invalid configuration GitHub Actions is "able to start" (result 0):

From the failure logs:

14:11:07                 out:         result, _ = nodes[NODE_BAR].exec_run('systemctl restart bluechi-agent')
14:11:07                 out: >       assert result == 1
14:11:07                 out: E       assert 0 == 1

@dougsland
Copy link
Contributor Author

Testing locally the new validation:

OS:

# cat /etc/redhat-release
CentOS Stream release 9

Running with tmt:

#control> echo "tier: 1" >> tests/tests/tier0/bluechi-agent-invalid-port-configuration/main.fmf
#control> tmt run test --filter tier:1
/var/tmp/tmt/run-001

/plans/tier0
    discover
        how: fmf
        directory: /root/invalidconfig/bluechi/invalidconfig/bluechi/tests
        filter: tier:1
        summary: 1 test selected
    provision
        how: local
        multihost name: default-0
        arch: x86_64
        distro: CentOS Stream 9
        summary: 1 guest provisioned
    prepare
        queued push task #1: push on default-0

        push task #1: push on default-0

        queued prepare task #1: Set containers setup on default-0

        prepare task #1: Set containers setup on default-0
        how: shell
        name: Set containers setup
        overview: 1 script found

        queued pull task #1: pull on default-0

        pull task #1: pull on default-0

        summary: 1 preparation applied
    execute
        queued execute task #1: default-0 on default-0

        execute task #1: default-0 on default-0
        how: tmt
        progress:
        summary: 1 test executed
    report
        how: junit
        output: /var/tmp/tmt/run-001/plans/tier0/report/default-0/junit.xml
        summary: 1 test passed
    finish

        summary: 0 tasks completed

total: 1 test passed

@dougsland
Copy link
Contributor Author

dougsland commented Aug 19, 2023

changing the approach to using the output string from systemctl status bluechi-agent still do NOT make GitHub Actions happy. 😖 Locally it just works as checking the return from shell. /me thinking....

out: test_agent_invalid_port_configuration.py:23: Exception
18:19:20                 out: =========================== short test summary info ============================
18:19:20                 out: FAILED test_agent_invalid_port_configuration.py::test_agent_invalid_port_configuration - Exception: bluechi-agent should FAILED during the restart but DO NOT FAILED
18:19:20                 out: ============================== 1 failed in 3.35s ===============================

@dougsland dougsland force-pushed the invalidport branch 4 times, most recently from e9026a5 to 10772b1 Compare August 20, 2023 12:24
@dougsland
Copy link
Contributor Author

okay, found that during the tmt tests in Github Actions systemd was trying to restart the service and the output of systemctl status bluechi-agent was "activating" but we had a failure count = 1. Updated the test, green light to review and merge if accepted.

Locally also pass:

# tmt run test --filter tier:1
/var/tmp/tmt/run-014

/plans/tier0
    discover
        how: fmf
        directory: /root/final/bluechi/tests
        filter: tier:1
        summary: 1 test selected
    provision
        how: local
        multihost name: default-0
        arch: x86_64
        distro: CentOS Stream 9
        summary: 1 guest provisioned
    prepare
        queued push task #1: push on default-0

        push task #1: push on default-0

        queued prepare task #1: Set containers setup on default-0

        prepare task #1: Set containers setup on default-0
        how: shell
        name: Set containers setup
        overview: 1 script found

        queued pull task #1: pull on default-0

        pull task #1: pull on default-0

        summary: 1 preparation applied
    execute
        queued execute task #1: default-0 on default-0

        execute task #1: default-0 on default-0
        how: tmt
        progress:
        summary: 1 test executed
    report
        how: junit
        output: /var/tmp/tmt/run-014/plans/tier0/report/default-0/junit.xml
        summary: 1 test passed
    finish

        summary: 0 tasks completed

total: 1 test passed

Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few NITs, but otherwise looks great!

This test includes three nodes: bluechi-controller, node-foo, node-bar.

- bluechi-controller is the controller node

- node-foo will start the agent service with normal
  configuration using port 8420

- node-bar will try to start the agent service with
  incorrect port (842O) and should fail (as expected)

Signed-off-by: Douglas Schilling Landgraf <[email protected]>
Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dougsland
Copy link
Contributor Author

LGTM

Thanks for the comments, let's make it fly! One more test integration added \o/

@dougsland dougsland merged commit 8608790 into eclipse-bluechi:main Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants