This PR will introduce new integration tests that will tests running the new fault injection endpoints within TMDS in parallel. These tests will only be running for linux and will need sudo permissions to run the utility tools such as iptables and tc
Implementation details
getFaultInjectionTaskResponse(): Helper function to build a TaskResponseobject with fault injection configurations. This will be used during the tests
getHostNetworkInterfaceName(): helper function that uses the DefaultNetInterfaceName() function to get the default host network interface name. It is used when constructing the TaskResponse object in getFaultInjectionTaskResponse()
getNetworkBlackHolePortRequestBody(): Getter function to create a request body for network black hole port requests
getNetworkLatencyRequestBody(): Getter function to create a request body for network latency requests
getNetworkPacketLossRequestBody(): Getter function to create a request body for network packet loss requests
startServer(): This function will create and start up a new HTTP server that will include all of the network fault handlers and will create all of the mocks used during the tests.
shutdownServer(): Helper function to stop/shutdown the HTTP server in startServer().
getURL(): Helper function to construct the URL of the fault injection endpoints
cleanupBlackHolePortFault(): Helper function that will hit the network-black-hole-port/stop endpoints to stop/clean up the black hole port fault on the host
cleanupLatencyAndPacketLossFaults(): Helper function that will hit both network-latency/stop and network-packet-loss/stop endpoint to clean up both latency and packet loss faults on the host
skipForUnsupportedTc(): Helper function that tests whether or not the tc utility installed on the host can use the -j flag. If it can't then we will skip running the integ tests
Testing
New tests cases:
Make 2 network black hole port in parallel
Make 2 network latency in parallel
Make 2 network packet loss in parallel
Make 1 network latency and 1 packet loss in parallel
Make 1 network black hole port and 1 latency in parallel
Make 1 network black hole port and 1 packet loss in parallel
Summary
This PR will introduce new integration tests that will tests running the new fault injection endpoints within TMDS in parallel. These tests will only be running for linux and will need sudo permissions to run the utility tools such as
iptables
andtc
Implementation details
getFaultInjectionTaskResponse()
: Helper function to build aTaskResponse
object with fault injection configurations. This will be used during the testsgetHostNetworkInterfaceName()
: helper function that uses theDefaultNetInterfaceName()
function to get the default host network interface name. It is used when constructing theTaskResponse
object ingetFaultInjectionTaskResponse()
getNetworkBlackHolePortRequestBody()
: Getter function to create a request body for network black hole port requestsgetNetworkLatencyRequestBody()
: Getter function to create a request body for network latency requestsgetNetworkPacketLossRequestBody()
: Getter function to create a request body for network packet loss requestsstartServer()
: This function will create and start up a new HTTP server that will include all of the network fault handlers and will create all of the mocks used during the tests.shutdownServer()
: Helper function to stop/shutdown the HTTP server instartServer()
.getURL()
: Helper function to construct the URL of the fault injection endpointscleanupBlackHolePortFault()
: Helper function that will hit the network-black-hole-port/stop endpoints to stop/clean up the black hole port fault on the hostcleanupLatencyAndPacketLossFaults()
: Helper function that will hit both network-latency/stop and network-packet-loss/stop endpoint to clean up both latency and packet loss faults on the hostskipForUnsupportedTc()
: Helper function that tests whether or not thetc
utility installed on the host can use the-j
flag. If it can't then we will skip running the integ testsTesting
Manually ran the tests:
New tests cover the changes: yes
Description for the changelog
Feature: Adding fault injection integration tests
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions?
**Does this PR include the addition of new environment variables in the README?**Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.