applicationhealth-extension.../integration-test
frank-pang-msft e5522df90c
Record app health heartbeat + default ExtensionEvent OperationId to VMWatchCohortId (#93)
Record app health heartbeat every 5 mins + default ExtensionEvent OperationId to VMWatchCohortId if VMWatchSettings specifies it in EnvironmentAttributes.
2024-11-19 17:39:02 -08:00
..
env update binary under integration folder 2024-09-16 19:04:14 -07:00
test Record app health heartbeat + default ExtensionEvent OperationId to VMWatchCohortId (#93) 2024-11-19 17:39:02 -08: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.