Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

integration: add hypervisor kill test#1839

Merged
chavafg merged 1 commit intokata-containers:masterfrom
bergwolf:stability
Jul 22, 2019
Merged

integration: add hypervisor kill test#1839
chavafg merged 1 commit intokata-containers:masterfrom
bergwolf:stability

Conversation

@bergwolf
Copy link
Copy Markdown
Member

Kill hypervisor and then force remove the container.
We should be able to handle the exceptional case properly.

Fixes: #1838
Depends-on: github.com/kata-containers/runtime#1897

@bergwolf
Copy link
Copy Markdown
Member Author

/test

@GabyCT updated. PTAL.

Copy link
Copy Markdown
Contributor

@chavafg chavafg left a comment

Choose a reason for hiding this comment

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

Should we add this to the make test recipe? Right now this is not being called anywhere/

@bergwolf bergwolf force-pushed the stability branch 2 times, most recently from c36153a to e197b9f Compare July 22, 2019 03:05
@bergwolf
Copy link
Copy Markdown
Member Author

/retest

PR updated. PTAL, thanks!

Copy link
Copy Markdown

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @bergwolf.

lgtm

@@ -0,0 +1,52 @@
#!/bin/bash
#
# Copyright (c) 2019 HyperHQ Inc.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OOI, Is the company name still correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We are still using hyper.sh for kata containers development so far ;)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ack ;)

clean_env
sudo docker run --runtime=$RUNTIME -d --name $CONTAINER_NAME $IMAGE $PAYLOAD_ARGS
num=$(ps aux | grep ${HYPERVISOR_PATH} | grep -v grep | wc -l)
[[ ${num} -eq 1 ]] || die "hypervisor count:${num} expected:1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: I think for the tests this script is performing, you can use a single square bracket, which is slightly clearer to read:

[  ${num} -eq 1 ] || ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated. Thanks!

[[ ${num} -eq 1 ]] || die "hypervisor count:${num} expected:1"
}

killhypervisor() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: CamelCase or snake_case would make this function name easier to read.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated. Thanks!

Kill hypervisor and then force remove the container.
We should be able to handle the exceptional case properly.

Fixes: kata-containers#1838
Depends-on: github.com/kata-containers/runtime#1897
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
@bergwolf
Copy link
Copy Markdown
Member Author

/test

Copy link
Copy Markdown

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @bergwolf.

lgtm

@@ -0,0 +1,52 @@
#!/bin/bash
#
# Copyright (c) 2019 HyperHQ Inc.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ack ;)

@chavafg chavafg merged commit d827dc2 into kata-containers:master Jul 22, 2019
@bergwolf
Copy link
Copy Markdown
Member Author

oh, it depends on github.com/kata-containers/runtime#1897 and that one is blocked due to a last minute merge conflict.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add add hypervisor kill test

5 participants