Skip to content

Initial version #1

Merged
merged 4 commits into from Oct 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
log.html
output.xml
pip-selfcheck.json
report.html
28 changes: 28 additions & 0 deletions All_Entities.robot
@@ -0,0 +1,28 @@
*** Settings ***
Library XML
Resource MDQ.robot
Default Tags all-entities

*** Test Cases ***
Get All Entities
[Documentation] GET all entities
[Tags] http-get
${resp}= Get uri=/entities
Should Be Equal As Strings ${resp.status_code} 200
#${root}= Parse XML ${resp.text}
#Should Be Equal ${root.tag} EntitiesDescriptor

Gzip Encoding
[Documentation] GET all entities with gzip encoding
[Tags] http-get gzip
${resp}= Get With Gzip uri=/entities/urn:mace:incommon:internet2.edu
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal ${resp.encoding} gzip
#${root}= Parse XML ${resp.text}
#Should Be Equal ${root.tag} EntitiesDescriptor

Head All Entities
[Documentation] HEAD all entities
[Tags] http-head
${resp}= Head uri=/entities
Should Be Equal As Strings ${resp.status_code} 200
23 changes: 23 additions & 0 deletions MDQ.robot
@@ -0,0 +1,23 @@
*** Settings ***
Library RequestsLibrary

*** Keywords ***
Get
[Arguments] ${uri}
Create Session alias=md url=http://md.sandbox.ti.internet2.edu
${resp}= Get Request alias=md uri=${uri}
[Return] ${resp}

Get With Gzip
[Arguments] ${uri}
Create Session alias=md url=http://md.sandbox.ti.internet2.edu
&{headers}= Create Dictionary Accept-Encoding=gzip
${resp}= Get Request alias=md uri=${uri} headers=&{headers}
[Return] ${resp}

Head
[Arguments] ${uri}
Log ${uri}
Create Session alias=md url=http://md.sandbox.ti.internet2.edu
${resp}= Head Request alias=md uri=${uri}
[Return] ${resp}
55 changes: 55 additions & 0 deletions README.md
@@ -1,2 +1,57 @@
# md-query-saml-uat

User acceptance tests for a service implementing the SAML metadata profile of the Metadata Query Protocol


## Prerequisites

1. Install Robot Framework (see https://github.com/robotframework/robotframework/blob/master/INSTALL.rst)


## Quick Start

1. Clone this repository:
```
git clone https://github.internet2.edu/internet2/md-query-saml-uat.git
```

2. Run the robot test suite:
```
robot .
```


## Usage

Run all tests:

```
robot .
```

Run metadata aggregate tests:

```
robot All_Entities.robot
```

Run single entity tests:

```
robot Single_Entity.robot
```


## To Do

1. Isolate Python dependencies with `virtualenv` or similar.


## Contributing

1. Clone the repository.
2. Create a new feature branch (optionally named for a JIRA issue, if applicable, e.g. `MDQ-1234-my-feature`).
3. Commit your changes and push to GitHub Enterprise.
4. Create a pull request from your feature branch against the `master` branch.
5. Merge your pull request to the `master` branch.
6. After your changes are merged, you can delete your feature branch.
77 changes: 77 additions & 0 deletions Single_Entity.robot
@@ -0,0 +1,77 @@
*** Settings ***
Library XML
Resource MDQ.robot
Default Tags single-entity

*** Test Cases ***
URN-Style Entity ID
[Documentation] GET an entity with a URN-style entityID
[Tags] http-get entity-id-urn
${resp}= Get uri=/entities/urn:mace:incommon:internet2.edu
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

URL-Style Entity ID
[Documentation] GET an entity with a URL-style entityID
[Tags] http-get entity-id-url
${resp}= Get uri=/entities/https:%2f%2fcarmenwiki.osu.edu%2fshibboleth
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

Gzip Encoding
[Documentation] GET an entity with gzip encoding
[Tags] http-get entity-id-urn gzip
${resp}= Get With Gzip uri=/entities/urn:mace:incommon:internet2.edu
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal ${resp.encoding} gzip
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

Colons Encoded
[Documentation] GET an entity with colons in the entityID percent-encoded
[Tags] http-get entity-id-urn encode-colons
${resp}= Get uri=/entities/urn%3Amace%3Aincommon%3Ainternet2.edu
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

Lowercase Encoding
[Documentation] GET an entity using lowercase percent-encoding
[Tags] http-get entity-id-url encoding-lowercase
${resp}= Get uri=/entities/https:%2f%2fcarmenwiki.osu.edu%2fshibboleth
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

Uppercase Encoding
[Documentation] GET an entity using uppercase percent-encoding
[Tags] http-get entity-id-url encoding-uppercase
${resp}= Get uri=/entities/https:%2F%2Fcarmenwiki.osu.edu%2Fshibboleth
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

SHA-1 Hash (Lowercase)
[Documentation] GET an entity by the lowercase SHA-1 hash of its entityID
[Tags] http-get sha-1 sha-1-lowercase
# `$ echo urn:mace:incommon:internet2.edu |shasum`
${resp}= Get uri=/entities/15fd47b743804831a6a443a37170c8983116c7a2
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

SHA-1 Hash (Uppercase)
[Documentation] GET an entity by the uppercase SHA-1 hash of its entityID
[Tags] http-get sha-1 sha-1-uppercase
${resp}= Get uri=/entities/15FD47B743804831A6A443A37170C8983116C7A2
Should Be Equal As Strings ${resp.status_code} 200
${root}= Parse XML ${resp.text}
Should Be Equal ${root.tag} EntityDescriptor

Head Entity
[Documentation] HEAD an entity
[Tags] http-head entity-id-urn
${resp}= Head uri=/entities/urn:mace:incommon:internet2.edu
Should Be Equal As Strings ${resp.status_code} 200
4 changes: 4 additions & 0 deletions __init__.robot
@@ -0,0 +1,4 @@
*** Settings ***
Documentation Acceptance test suite for a service implementing the SAML
... metadata profile of the Metadata Query Protocol
... (https://tools.ietf.org/html/draft-young-md-query-saml-09).