aboutsummaryrefslogtreecommitdiffstats
path: root/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests
diff options
context:
space:
mode:
authorWuKong <rebirthmonkey@gmail.com>2017-12-23 21:49:35 +0100
committerWuKong <rebirthmonkey@gmail.com>2017-12-23 21:49:58 +0100
commit1100c66ce03a059ebe7ece9734e799b49b3a5a9e (patch)
treea057e7e7511f6675a9327b79e6919f07c5f89f07 /upstream/odl-aaa-moon/aaa/aaa-idmlight/tests
parent7a4dfdde6314476ae2a1a1c881ff1e3c430f790e (diff)
moonv4 cleanup
Change-Id: Icef927f3236d985ac13ff7376f6ce6314b2b39b0 Signed-off-by: WuKong <rebirthmonkey@gmail.com>
Diffstat (limited to 'upstream/odl-aaa-moon/aaa/aaa-idmlight/tests')
-rwxr-xr-xupstream/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh5
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json5
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json5
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json4
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json4
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json1
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json4
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json4
-rwxr-xr-xupstream/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh308
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json7
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json7
-rw-r--r--upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json4
12 files changed, 0 insertions, 358 deletions
diff --git a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/cleardb.sh
deleted file mode 100755
index 6385b48d..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain.json
deleted file mode 100644
index 4dfd25e9..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json
deleted file mode 100644
index 69244b30..00000000
--- a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/domain2.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "domainid": "1",
- "name":"ATG",
- "enabled":"true"
-}
diff --git a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json
deleted file mode 100644
index 0c4a9e90..00000000
--- a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "roleid":"2",
- "description":"role grant"
-}
diff --git a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json
deleted file mode 100644
index ad685b7a..00000000
--- a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/grant2.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "roleid":"3",
- "description":"role grant"
-}
diff --git a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/result.json
deleted file mode 100644
index a3dd995d..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-admin.json
deleted file mode 100644
index cf93caae..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/role-user.json
deleted file mode 100644
index 78588c9a..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/test.sh
deleted file mode 100755
index 3589be58..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user.json
deleted file mode 100644
index 6f30d705..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/user2.json
deleted file mode 100644
index 9864cdb2..00000000
--- a/upstream/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/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json b/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json
deleted file mode 100644
index e5258b98..00000000
--- a/upstream/odl-aaa-moon/aaa/aaa-idmlight/tests/userpwd.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "username":"peter",
- "userpwd":"foobar"
-}