Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
be6e49dd
Commit
be6e49dd
authored
Jan 20, 2015
by
Matt Martz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for rax_cdb_database
parent
952aa0c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
221 additions
and
0 deletions
+221
-0
test/integration/rackspace.yml
+3
-0
test/integration/roles/test_rax_cdb_database/meta/main.yml
+3
-0
test/integration/roles/test_rax_cdb_database/tasks/main.yml
+215
-0
No files found.
test/integration/rackspace.yml
View file @
be6e49dd
...
...
@@ -37,3 +37,6 @@
-
role
:
test_rax_cdb
tags
:
test_rax_cdb
-
role
:
test_rax_cdb_database
tags
:
test_rax_cdb_database
test/integration/roles/test_rax_cdb_database/meta/main.yml
0 → 100644
View file @
be6e49dd
dependencies
:
-
prepare_tests
-
prepare_rax_tests
test/integration/roles/test_rax_cdb_database/tasks/main.yml
0 → 100644
View file @
be6e49dd
# ============================================================
-
name
:
Test rax_cdb_database with no args
rax_cdb_database
:
ignore_errors
:
true
register
:
rax_cdb_database
-
name
:
Validate results of rax_cdb_database with no args
assert
:
that
:
-
rax_cdb_database|failed
-
rax_cdb_database.msg == 'missing required arguments
:
name,cdb_id'
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database with name
rax_cdb_database
:
name
:
fail
ignore_errors
:
true
register
:
rax_cdb_database
-
name
:
Validate results of rax_cdb_database with name
assert
:
that
:
-
rax_cdb_database|failed
-
rax_cdb_database.msg == 'missing required arguments
:
cdb_id'
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database with name and cdb_id
rax_cdb_database
:
name
:
fail
cdb_id
:
'
1234'
ignore_errors
:
true
register
:
rax_cdb_database
-
name
:
Validate results of rax_cdb_database with name and cdb_id
assert
:
that
:
-
rax_cdb_database|failed
-
rax_cdb_database.msg == 'No credentials supplied!'
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database with name, cdb_id and creds
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
name
:
fail
cdb_id
:
'
1234'
ignore_errors
:
true
register
:
rax_cdb_database
-
name
:
Validate results of rax_cdb_database with name, cdb_id and creds
assert
:
that
:
-
rax_cdb_database|failed
-
rax_cdb_database.msg.startswith('None is not a valid region')
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database with name, invalid cdb_id, creds and region
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
fail
cdb_id
:
'
1234'
ignore_errors
:
true
register
:
rax_cdb_database
-
name
:
Validate rax_cdb_database name, invalid cdb_id, creds and region
assert
:
that
:
-
rax_cdb_database|failed
# ============================================================
# ============================================================
-
name
:
Build Cloud Database for testing
rax_cdb
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-rax_cdb_database"
wait
:
true
register
:
rax_cdb
-
name
:
Validate build
assert
:
that
:
-
rax_cdb|success
-
rax_cdb|changed
-
rax_cdb.cdb.name == '{{ resource_prefix }}-rax_cdb_database'
-
rax_cdb.cdb.status == 'ACTIVE'
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database with name, cdb_id, creds and region
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-1"
cdb_id
:
"
{{
rax_cdb.cdb.id
}}"
register
:
rax_cdb_database
-
name
:
Validate rax_cdb_database name, cdb_id, creds and region
assert
:
that
:
-
rax_cdb_database|success
-
rax_cdb_database|changed
-
rax_cdb_database.database.name == "{{ resource_prefix }}-1"
-
name
:
Delete integration 1
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-1"
cdb_id
:
"
{{
rax_cdb.cdb.id
}}"
state
:
absent
register
:
rax_cdb_database
-
name
:
Validate delete integration 1
assert
:
that
:
-
rax_cdb_database|success
-
rax_cdb_database|changed
-
rax_cdb_database.database.name == "{{ resource_prefix }}-1"
# ============================================================
# ============================================================
-
name
:
Test rax_cdb_database idempotency 1
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-2"
cdb_id
:
"
{{
rax_cdb.cdb.id
}}"
register
:
rax_cdb_database
-
name
:
Validate rax_cdb_database idempotency 1
assert
:
that
:
-
rax_cdb_database|success
-
rax_cdb_database|changed
-
rax_cdb_database.database.name == "{{ resource_prefix }}-2"
-
name
:
Test rax_cdb_database idempotency 2
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-2"
cdb_id
:
"
{{
rax_cdb.cdb.id
}}"
register
:
rax_cdb_database
-
name
:
Validate rax_cdb_database idempotency 2
assert
:
that
:
-
rax_cdb_database|success
-
not rax_cdb_database|changed
-
rax_cdb_database.database.name == "{{ resource_prefix }}-2"
-
name
:
Delete integration 2
rax_cdb_database
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-2"
cdb_id
:
"
{{
rax_cdb.cdb.id
}}"
state
:
absent
register
:
rax_cdb_database
-
name
:
Validate delete integration 2
assert
:
that
:
-
rax_cdb_database|success
-
rax_cdb_database|changed
-
rax_cdb_database.database.name == "{{ resource_prefix }}-2"
# ============================================================
# ============================================================
-
name
:
Delete Cloud Database
rax_cdb
:
username
:
"
{{
rackspace_username
}}"
api_key
:
"
{{
rackspace_api_key
}}"
region
:
"
{{
rackspace_region
}}"
name
:
"
{{
resource_prefix
}}-rax_cdb_database"
state
:
absent
wait
:
true
register
:
rax_cdb
-
name
:
Validate Delete
assert
:
that
:
-
rax_cdb|success
-
rax_cdb|changed
-
rax_cdb.cdb.name == "{{ resource_prefix }}-rax_cdb_database"
# ============================================================
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment