summaryrefslogtreecommitdiffstats
path: root/odl-aaa-moon/aaa/aaa-idmlight/tests
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2016-09-12 11:06:56 -0700
committerThomas Duval <thomas.duval@orange.com>2016-09-20 10:38:38 +0200
commitba20dff39a897ff8dbd71260c42da923c9bdcf7a (patch)
treec3697f48fad868f74bf3b363dae43519d9045a1b /odl-aaa-moon/aaa/aaa-idmlight/tests
parentcdcd1fd6690b69af3a3cf4b430e51e4febec1c9a (diff)
Move ODL-AAA-MOON under 'upstream' Directory
Change-Id: Ie010fbe3899e151421940908dbe8675aade54e2d Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org> (cherry picked from commit cf864337c13b4638c588badf3f589f9e39318c95)
Diffstat (limited to 'odl-aaa-moon/aaa/aaa-idmlight/tests')
-rwxr-xr-xodl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh5
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json5
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json5
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json4
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json4
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/result.json1
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json4
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json4
-rwxr-xr-xodl-aaa-moon/aaa/aaa-idmlight/tests/test.sh308
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/user.json7
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json7
-rw-r--r--odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json4
12 files changed, 0 insertions, 358 deletions
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh b/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh
deleted file mode 100755
index 6385b48d..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-sudo service idmlight stop
-echo "dropping all tables..."
-sleep 3
-sudo sqlite3 /opt/idmlight/dmlight.db < ../sql/idmlight.sql
-sudo service idmlight start
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json
deleted file mode 100644
index 4dfd25e9..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "domainid": "1",
- "name":"R&D",
- "enabled":"true"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json
deleted file mode 100644
index 69244b30..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "domainid": "1",
- "name":"ATG",
- "enabled":"true"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json
deleted file mode 100644
index 0c4a9e90..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "roleid":"2",
- "description":"role grant"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json
deleted file mode 100644
index ad685b7a..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "roleid":"3",
- "description":"role grant"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json
deleted file mode 100644
index a3dd995d..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json
+++ /dev/null
@@ -1 +0,0 @@
-{"domainid":2,"userid":2,"username":"peter","roles":[{"roleid":2,"name":"user","description":"A user role with limited access"},{"roleid":3,"name":"user","description":"A user role with limited access"}]} \ No newline at end of file
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json
deleted file mode 100644
index cf93caae..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name":"admin",
- "description":"An admin role with full access"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json
deleted file mode 100644
index 78588c9a..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name":"user",
- "description":"A user role with limited access"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh b/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh
deleted file mode 100755
index 3589be58..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh
+++ /dev/null
@@ -1,308 +0,0 @@
-# GLOBAL VARS
-TARGET="localhost:8282/auth"
-TESTCOUNT=0
-PASSCOUNT=0
-FAILCOUNT=0
-
-getit() {
-((TESTCOUNT++))
-echo '['$TESTCOUNT']' $NAME
-echo GET $URL
-echo "Desired Result=" $PASSCODE
-STATUS=$(curl -X GET -k -s -H Accept:application/json -o result.json -w '%{http_code}' $URL)
-if [ $STATUS -eq $PASSCODE ]; then
- ((PASSCOUNT++))
- cat result.json | python -mjson.tool
- echo "[PASS] Status=" $STATUS
-else
- cat result.json | python -mjson.tool
- echo "[FAIL] Status=" $STATUS
- ((FAILCOUNT++))
-fi
-echo
-}
-
-
-deleteit() {
-((TESTCOUNT++))
-echo '['$TESTCOUNT']' $NAME
-echo DELETE $URL
-echo "Desired Result=" $PASSCODE
-STATUS=$(curl -X DELETE -k -s -H Accept:application/json -o result.json -w '%{http_code}' $URL)
-if [ $STATUS -eq $PASSCODE ]; then
- ((PASSCOUNT++))
- echo "[PASS] Status=" $STATUS
-else
- cat result.json | python -mjson.tool
- echo "[FAIL] Status=" $STATUS
- ((FAILCOUNT++))
-fi
-echo
-}
-
-postit() {
-((TESTCOUNT++))
-echo '['$TESTCOUNT']' $NAME
-echo POST $URL
-echo "Desired Result=" $PASSCODE
-echo "POST File=" $POSTFILE
-STATUS=$(curl -X POST -k -s -H "Content-type:application/json" --data-binary "@"$POSTFILE -o result.json -w '%{http_code}' $URL)
-if [ $STATUS -eq $PASSCODE ]; then
- ((PASSCOUNT++))
- cat result.json | python -mjson.tool
- echo "[PASS] Status=" $STATUS
-else
- cat result.json | python -mjson.tool
- echo "[FAIL] Status=" $STATUS
- ((FAILCOUNT++))
-fi
-echo
-}
-
-putit() {
-((TESTCOUNT++))
-echo '['$TESTCOUNT']' $NAME
-echo PUT $URL
-echo "Desired Result=" $PASSCODE
-echo "PUT file=" $PUTFILE
-STATUS=$(curl -X PUT -k -s -H "Content-type:application/json" --data-binary "@"$PUTFILE -o result.json -w '%{http_code}' $URL)
-if [ $STATUS -eq $PASSCODE ]; then
- ((PASSCOUNT++))
- cat result.json | python -mjson.tool
- echo "[PASS] Status=" $STATUS
-else
- cat result.json | python -mjson.tool
- echo "[FAIL] Status=" $STATUS
- ((FAILCOUNT++))
-fi
-echo
-}
-
-
-#
-# DOMAIN TESTS
-#
-
-NAME="get all domains"
-URL="http://$TARGET/v1/domains"
-PASSCODE=200
-getit
-
-NAME="create a new domain"
-URL="http://$TARGET/v1/domains"
-POSTFILE=domain.json
-PASSCODE=201
-postit
-
-NAME="get domain 1"
-URL="http://$TARGET/v1/domains/1"
-PASSCODE=200
-getit
-
-NAME="delete domain 1"
-URL="http://$TARGET/v1/domains/1"
-PASSCODE=204
-deleteit
-
-NAME="create a new domain"
-URL="http://$TARGET/v1/domains"
-POSTFILE=domain.json
-PASSCODE=201
-postit
-
-NAME="get all domains"
-URL="http://$TARGET/v1/domains"
-PASSCODE=200
-getit
-
-NAME="update domain 2"
-URL="http://$TARGET/v1/domains/2"
-PUTFILE=domain.json
-PASSCODE=200
-putit
-
-NAME="create a new domain"
-URL="http://$TARGET/v1/domains"
-POSTFILE=domain2.json
-PASSCODE=201
-postit
-
-NAME="get all domains"
-URL="http://$TARGET/v1/domains"
-PASSCODE=200
-getit
-
-#
-# USER TESTS
-#
-
-NAME="get all users"
-URL="http://$TARGET/v1/users"
-PASSCODE=200
-getit
-
-NAME="create a new user"
-URL="http://$TARGET/v1/users"
-POSTFILE=user.json
-PASSCODE=201
-postit
-
-NAME="get all users"
-URL="http://$TARGET/v1/users"
-PASSCODE=200
-getit
-
-NAME="get user 1"
-URL="http://$TARGET/v1/users/1"
-PASSCODE=200
-getit
-
-NAME="delete user 1"
-URL="http://$TARGET/v1/users/1"
-PASSCODE=204
-deleteit
-
-NAME="get all users"
-URL="http://$TARGET/v1/users"
-PASSCODE=200
-getit
-
-NAME="create a new user"
-URL="http://$TARGET/v1/users"
-POSTFILE=user.json
-PASSCODE=201
-postit
-
-NAME="update a user"
-URL="http://$TARGET/v1/users/2"
-PUTFILE=user.json
-PASSCODE=200
-putit
-
-NAME="create a new user"
-URL="http://$TARGET/v1/users"
-POSTFILE=user2.json
-PASSCODE=201
-postit
-
-NAME="get all users"
-URL="http://$TARGET/v1/users"
-PASSCODE=200
-getit
-
-# ROLE TESTS
-
-NAME="get all roles"
-URL="http://$TARGET/v1/roles"
-PASSCODE=200
-getit
-
-NAME="create a new role"
-URL="http://$TARGET/v1/roles"
-POSTFILE=role-user.json
-PASSCODE=201
-postit
-
-NAME="get all roles"
-URL="http://$TARGET/v1/roles"
-PASSCODE=200
-getit
-
-NAME="get role 1"
-URL="http://$TARGET/v1/roles/1"
-PASSCODE=200
-getit
-
-NAME="delete role 1"
-URL="http://$TARGET/v1/roles/1"
-PASSCODE=204
-deleteit
-
-NAME="create a new role"
-URL="http://$TARGET/v1/roles"
-POSTFILE=role-user.json
-PASSCODE=201
-postit
-
-NAME="update role 2"
-URL="http://$TARGET/v1/roles/2"
-PUTFILE=role-user.json
-PASSCODE=200
-putit
-
-NAME="create a new role"
-URL="http://$TARGET/v1/roles"
-POSTFILE=role-admin.json
-PASSCODE=201
-postit
-
-NAME="get all roles"
-URL="http://$TARGET/v1/roles"
-PASSCODE=200
-getit
-
-# Grant tests
-
-NAME="grant a role"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-POSTFILE=grant.json
-PASSCODE=201
-postit
-
-NAME="try to create a double grant"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-POSTFILE=grant.json
-PASSCODE=403
-postit
-
-NAME="get all roles for domain and user"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-PASSCODE=200
-getit
-
-NAME="delete a grant"
-URL="http://$TARGET/v1/domains/2/users/2/roles/2"
-PASSCODE=204
-deleteit
-
-NAME="delete a grant"
-URL="http://$TARGET/v1/domains/2/users/2/roles/2"
-PASSCODE=404
-deleteit
-
-NAME="get all roles for domain and user"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-PASSCODE=200
-getit
-
-NAME="grant a role"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-POSTFILE=grant.json
-PASSCODE=201
-postit
-
-NAME="grant a role"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-POSTFILE=grant2.json
-PASSCODE=201
-postit
-
-NAME="get all roles for domain and user"
-URL="http://$TARGET/v1/domains/2/users/2/roles"
-PASSCODE=200
-getit
-
-NAME="get all roles for domain, user and pwd"
-URL="http://$TARGET/v1/domains/2/users/roles"
-POSTFILE=userpwd.json
-PASSCODE=200
-postit
-
-
-#
-# RESULTS
-#
-echo "SUMMARY"
-echo "======================================"
-echo 'TESTS:'$TESTCOUNT 'PASS:'$PASSCOUNT 'FAIL:'$FAILCOUNT
-
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json
deleted file mode 100644
index 6f30d705..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name":"peter",
- "description":"peter test user",
- "enabled":"true",
- "email":"user1@gmail.com",
- "password":"foobar"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json
deleted file mode 100644
index 9864cdb2..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name":"liem",
- "description":"liem test user",
- "enabled":"true",
- "email":"user1@gmail.com",
- "password":"foobar"
-}
diff --git a/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json b/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json
deleted file mode 100644
index e5258b98..00000000
--- a/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "username":"peter",
- "userpwd":"foobar"
-}