-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split test to have one test per mode
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
*** Settings *** | ||
Documentation AWS CloudTrail plugin | ||
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource | ||
|
||
Suite Setup Start Mockoon ${MOCKOON_JSON} | ||
Suite Teardown Stop Mockoon | ||
Test Timeout 120s | ||
|
||
|
||
*** Variables *** | ||
${MOCKOON_JSON} ${CURDIR}${/}cloud-aws-cloudtrail.json | ||
|
||
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::aws::cloudtrail::plugin --custommode=paws --region=eu-west --aws-secret-key=secret --aws-access-key=key | ||
|
||
|
||
*** Test Cases *** | ||
AWS CloudTrail check trail status | ||
[Documentation] Check AWS CloudTrail trail status | ||
[Tags] cloud aws cloudtrail | ||
${command} Catenate | ||
... ${CMD} | ||
... --mode=checktrailstatus | ||
... --endpoint=http://${HOSTNAME}:${APIPORT}/cloudtrail/gettrailstatus/${trailstatus} | ||
... --trail-name=trailname | ||
Ctn Run Command And Check Result As Strings ${command} ${expected_result} | ||
|
||
Examples: tc trailstatus expected_result -- | ||
... 1 true OK: Trail is logging: 1 | 'trail_is_logging'=1;;;0; | ||
... 2 false CRITICAL: Trail is logging: 0 | 'trail_is_logging'=0;;;0; | ||
|
||
AWS CloudTrail count events | ||
[Documentation] Check AWS CloudTrail count events | ||
[Tags] cloud aws cloudtrail | ||
${command} Catenate | ||
... ${CMD} | ||
... --mode=countevents | ||
... --endpoint=http://localhost:3000/cloudtrail/events/AwsApiCall/${AwsApiCall}/AwsServiceEvent/${AwsServiceEvent}/AwsConsoleAction/${AwsConsoleAction}/AwsConsoleSignIn/${AwsConsoleSignIn}/NextToken/${NextToken} | ||
... ${extraoptions} | ||
Ctn Run Command And Check Result As Strings ${command} ${expected_result} | ||
|
||
Examples: tc AwsApiCall AwsServiceEvent AwsConsoleAction AwsConsoleSignIn NextToken extraoptions expected_result -- | ||
... 1 4 2 1 3 false ${EMPTY} OK: Number of events: 10.00 | 'events_count'=10.00;;;0; | ||
... 2 4 2 1 3 true ${EMPTY} OK: Number of events: 20.00 | 'events_count'=20.00;;;0; | ||
... 3 4 2 1 3 false --event-type=AwsApiCall OK: Number of events: 4.00 | 'events_count'=4.00;;;0; | ||
... 4 4 2 1 3 false --event-type=AwsServiceEvent OK: Number of events: 2.00 | 'events_count'=2.00;;;0; | ||
... 5 4 2 1 3 false --delta=10 OK: Number of events: 10.00 | 'events_count'=10.00;;;0; | ||
... 6 4 2 1 3 false --error-message='Login error' OK: Number of events: 3.00 | 'events_count'=3.00;;;0; | ||
... 7 4 2 1 3 false --error-message='.*error' OK: Number of events: 4.00 | 'events_count'=4.00;;;0; | ||
... 8 4 2 1 3 false --warning-count=3 WARNING: Number of events: 10.00 | 'events_count'=10.00;;;0; | ||
... 9 4 2 1 3 false --critical-count=5 CRITICAL: Number of events: 10.00 | 'events_count'=10.00;;;0; |