-
Notifications
You must be signed in to change notification settings - Fork 34
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-test: add test scenarios #32
Conversation
|
Running these tests looks like this
|
The integation tests use `bats` to run the scenarios as bash scripts. To test the extension handler functionality, we simply: - build a Docker image using test.Dockerfile - copy some files from ` make it look like a `/var/lib/waagent` directory - copy extension binary into the container - remove the `test` container if it exists - create a Docker container (name: `test`) from image - specify which handler subcommand will be invoked (e.g. `fake-waagent install`) - push .settings file and certificate/private key (.crt, .prv) - do other things on the container that we need to craft the environment - start the container - collect the output from the command execution - validate using the following: - check status code - validate output of the command - `docker diff test` to validate file changes in the container - copy files out of container and validate their contents Signed-off-by: Ahmet Alp Balkan <[email protected]>
} | ||
|
||
container_read_file() { # reads the file at container path $1 | ||
set -eo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this scoped to this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe setting -e globally has issues with bats sstephenson/bats#171
LGTM. |
The integration tests use
bats
to run the scenarios as bash scripts.To test the extension handler functionality, we simply:
make it look like a
/var/lib/waagent` directorytest
container if it existstest
) from imagefake-waagent install
)docker diff test
to validate file changes in the container