Skip to content
Permalink
Browse files

Initial version (#1)

* Working on tests
* Clean up files
* Create .gitignore
* Initial version
  • Loading branch information
dshafer committed Oct 12, 2018
1 parent 2a20bf7 commit d613bf1f3c12dbbb58684b55effe4905463ac06b
Showing with 191 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +28 −0 All_Entities.robot
  3. +23 −0 MDQ.robot
  4. +55 −0 README.md
  5. +77 −0 Single_Entity.robot
  6. +4 −0 __init__.robot
@@ -0,0 +1,4 @@
log.html
output.xml
pip-selfcheck.json
report.html
@@ -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
@@ -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}
@@ -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.
@@ -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
@@ -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).

0 comments on commit d613bf1

Please sign in to comment.
You can’t perform that action at this time.