applicationhealth-extension.../integration-test
Dave Poole 78910a6b1b chore(script): Update the script tp upload the test binaries to use the new account
we migrated to a new account so updating the script
2024-06-13 16:57:58 -07:00
..
env chore(script): Update the script tp upload the test binaries to use the new account 2024-06-13 16:57:58 -07:00
test fix(cgroups): Fixing the check for systemd-run (#70) 2024-05-16 15:17:26 -07:00
webserver
README.md
run.sh Adding Kusto Telemetry to ApplicationHealthLinux v2 (#63) 2024-05-01 23:46:04 -07:00

README.md

Integration Tests

This directory contains instructions and test files on how to test the extension binary in an environment that looks like an Azure Linux Virtual Machine.

Requirements

  • Install Docker Engine on Linux or Docker for Mac.
  • Install Bats.

Testing Strategy

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 to make it look like a /var/lib/waagent dir
    • 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
    • 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

Running Tests

To run the integration tests, run the following commands from the repository root:

make binary
./integration-test/run.sh

If you are running on a linux host (a real linux host not WSL), you can use the command ./integration-test/run.sh --all to run all the tests.