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

tests/nydus: refactor the teardown() #8949

Merged
merged 1 commit into from Feb 27, 2024

Conversation

wainersm
Copy link
Contributor

This refactor the teardown() of tests/integration/nydus/nydus_tests.sh:

  • Moved boilerplate code that kill process to a loop;
  • Doesn't leave teardown() if a process failed to get killed, so that other clean up routines are ran;
  • Check if the pid exist then attempt to kill the process, so avoid this misleading message:
Usage:
 kill [options] <pid> [...]

Options:
 <pid> [...]            send signal to every <pid> listed
 -<signal>, -s, --signal <signal>
                        specify the <signal> to be sent
 -q, --queue <value>    integer value to be sent with the signal
 -l, --list=[<signal>]  list all signal names, or convert one to a name
 -L, --table            list all signal names in a nice table

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see kill(1).

Fixes #8948

@wainersm wainersm added no-backport-needed area/testing Issues related to testing size/small Small and simple task labels Jan 29, 2024
Copy link
Member

@beraldoleal beraldoleal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@fidencio
Copy link
Member

fidencio commented Feb 7, 2024

/test

Copy link
Member

@ChengyuZhu6 ChengyuZhu6 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @wainersm

This refactor the teardown() of tests/integration/nydus/nydus_tests.sh:

* Moved boilerplate code that kill process to a loop;
* Doesn't leave teardown() if a process failed to get killed, so that
  other clean up routines are ran;
* Check if the pid exist then attempt to kill the process, so avoid this
  misleading message:
```
Usage:
 kill [options] <pid> [...]

Options:
 <pid> [...]            send signal to every <pid> listed
 -<signal>, -s, --signal <signal>
                        specify the <signal> to be sent
 -q, --queue <value>    integer value to be sent with the signal
 -l, --list=[<signal>]  list all signal names, or convert one to a name
 -L, --table            list all signal names in a nice table

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see kill(1).
```

Fixes kata-containers#8948
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
@wainersm
Copy link
Contributor Author

Rebased to main to re-run the jobs.

@wainersm
Copy link
Contributor Author

/test

@wainersm wainersm merged commit 6186410 into kata-containers:main Feb 27, 2024
292 of 296 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues related to testing ok-to-test size/small Small and simple task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/nydus: misleading error on teardown()
5 participants