Skip to content

Commit

Permalink
Example tests for Ambassador (API gateway) CRDs (#63)
Browse files Browse the repository at this point in the history
adding example tests for Ambassador CRDs
  • Loading branch information
Nilsty authored Mar 12, 2021
1 parent 2a47424 commit 6215736
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Keyword for list cronjob [#48](https://github.com/devopsspiral/KubeLibrary/pull/48) by [@satish-nubolab](https://github.com/satish-nubolab)
- Keyword for list daemonset [#50](https://github.com/devopsspiral/KubeLibrary/pull/50) by [@satish-nubolab](https://github.com/satish-nubolab)
- Keyword for CustomObjectsApi [#54](https://github.com/devopsspiral/KubeLibrary/pull/54) by [@mika-b](https://github.com/mika-b)
- Example tests for Ambassador CRDs [#63](https://github.com/devopsspiral/KubeLibrary/pull/63) by [@Nilsty](https://github.com/Nilsty)


### Fixed
- Fix for cert validation disabling not being possible for all api clients [#61](https://github.com/devopsspiral/KubeLibrary/pull/61) by [@m-wcislo](https://github.com/m-wcislo)
Expand Down
33 changes: 33 additions & 0 deletions testcases/custom_objects/ambassador_crds.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
*** Settings ***
Library KubeLibrary

Documentation These are example test cases to check custom resource definitions created by Ambassador.
... Ambassador is on open source API gateway solution. The most common CRDs created by ambassador
... are Mappings and Hosts, which control the routing of API requests to different services
... running in your cluster.
... https://www.getambassador.io/products/api-gateway/
... More details on Ambassador Mappings:
... https://www.getambassador.io/docs/pre-release/topics/using/intro-mappings/#introduction-to-the-mapping-resource
*** Test Cases ***
Get details for all ambassador mappings
${listed_mappings}= List Cluster Custom Objects getambassador.io v2 mappings
FOR ${mapping} IN @{listed_mappings['items']}
Log Mapping name: ${mapping}[metadata][name] console=True
Log Mapping namespace: ${mapping}[metadata][namespace] console=True
Log Mapping prefix: ${mapping}[spec][prefix] console=True
Log Mapping service: ${mapping}[spec][service] console=True
${status}= Run Keyword And Ignore Error Log Mapping status: ${mapping}[status][state] console=True
Run Keyword If '''FAIL''' in '''${status}''' Log ! Mapping ${mapping}[metadata][name] is not running console=True
Log --------------------------------------------------- console=True
END

Get details for all ambassador hosts
${listed_hosts}= List Cluster Custom Objects getambassador.io v2 hosts
FOR ${host} IN @{listed_hosts['items']}
Log Host name: ${host}[metadata][name] console=True
Log Host namespace: ${host}[metadata][namespace] console=True
Log Host hostname: ${host}[spec][hostname] console=True
Log Host status: ${host}[status][state] console=True
Log --------------------------------------------------- console=True
END

0 comments on commit 6215736

Please sign in to comment.