summaryrefslogtreecommitdiff
path: root/tests
diff options
authorbilly.olsen@canonical.com <>2016-05-05 10:08:05 -0700
committerbilly.olsen@canonical.com <>2016-05-05 10:08:05 -0700
commita71bc020ec12f543e8aaa0671c16c9b96e0ae7ca (patch)
tree1118938cb5c3323894bf8d36b2b73acdcb6028be /tests
parent87079a1babd0143bba4f5a5eca60470399061e89 (diff)
Move parameter logic from altering init conf file to the /etc/mongodb.conf
file. The mongdob service is already configured to read parameters from the /etc/mongodb.conf file and moving the configuration options inside the config file allows the systemd style service to start properly. Also, as of MongoDB 2.6, the specification of master/slave flags on startup is not allowed to be specified with the replicaset flags. This change allows for the master/slave flag to be specified in the /etc/mongodb.conf file only when the replica-set (peer) relation has not been established. Closes-Bug: #1513094
Diffstat (limited to 'tests')
-rwxr-xr-xtests/01_deploy_single.py4
-rwxr-xr-xtests/02_deploy_shard_test.py6
-rwxr-xr-xtests/03_deploy_replicaset.py6
-rwxr-xr-xtests/04_deploy_with_storage.py4
-rwxr-xr-xtests/50_relate_ceilometer_test.py2
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/01_deploy_single.py b/tests/01_deploy_single.py
index 885ee26..fd2cabc 100755
--- a/tests/01_deploy_single.py
+++ b/tests/01_deploy_single.py
@@ -5,7 +5,7 @@ from pymongo import MongoClient
seconds = 900
-d = amulet.Deployment(series='trusty')
+d = amulet.Deployment(series='xenial')
d.add('mongodb', charm='mongodb')
d.expose('mongodb')
@@ -36,7 +36,7 @@ def validate_world_connectivity():
amulet.raise_status(amulet.FAIL, msg="Failed to insert test data")
# Can we delete from a shard using the Mongos hub?
result = db.amulet.remove(insert_id)
- if result['err'] is not None:
+ if 'err' in result and result['err'] is not None:
amulet.raise_status(amulet.FAIL, msg="Failed to remove test data")
diff --git a/tests/02_deploy_shard_test.py b/tests/02_deploy_shard_test.py
index 2ff0750..5ff0250 100755
--- a/tests/02_deploy_shard_test.py
+++ b/tests/02_deploy_shard_test.py
@@ -16,7 +16,7 @@ seconds = 1400
#########################################################
# 3shard cluster configuration
#########################################################
-d = amulet.Deployment(series='trusty')
+d = amulet.Deployment(series='xenial')
d.add('configsvr', charm='mongodb', units=scale)
d.add('mongos', charm='mongodb', units=scale)
@@ -92,7 +92,7 @@ def validate_status_interface():
def validate_running_services():
for service in sentry_dict:
output = sentry_dict[service].run('service mongodb status')
- service_active = str(output).find('mongodb start/running')
+ service_active = str(output).find('active (running)')
if service_active == -1:
message = "Failed to find running MongoDB on host {}".format(
service)
@@ -115,7 +115,7 @@ def validate_world_connectivity():
amulet.raise_status(amulet.FAIL, msg="Failed to insert test data")
# Can we delete from a shard using the Mongos hub?
result = db.amulet.remove(insert_id)
- if result['err'] is not None:
+ if 'err' in result and result['err'] is not None:
amulet.raise_status(amulet.FAIL, msg="Failed to remove test data")
diff --git a/tests/03_deploy_replicaset.py b/tests/03_deploy_replicaset.py
index 02d25f5..7be3141 100755
--- a/tests/03_deploy_replicaset.py
+++ b/tests/03_deploy_replicaset.py
@@ -23,7 +23,7 @@ wait_for_replicaset = 600
#########################################################
# 3shard cluster configuration
#########################################################
-d = amulet.Deployment(series='trusty')
+d = amulet.Deployment(series='xenial')
d.add('mongodb', charm='mongodb', units=scale)
d.expose('mongodb')
@@ -63,7 +63,7 @@ def validate_status_interface():
def validate_running_services():
for service in sentry_dict:
output = sentry_dict[service].run('service mongodb status')
- service_active = str(output).find('mongodb start/running')
+ service_active = str(output).find('active (running)')
if service_active == -1:
message = "Failed to find running MongoDB on host {}".format(
service)
@@ -158,7 +158,7 @@ def validate_world_connectivity():
amulet.raise_status(amulet.FAIL, msg="Failed to insert test data")
# Can we delete from a shard using the Mongos hub?
result = db.amulet.remove(insert_id)
- if result['err'] is not None:
+ if 'err' in result and result['err'] is not None:
amulet.raise_status(amulet.FAIL, msg="Failed to remove test data")
diff --git a/tests/04_deploy_with_storage.py b/tests/04_deploy_with_storage.py
index 46aef57..347b7ef 100755
--- a/tests/04_deploy_with_storage.py
+++ b/tests/04_deploy_with_storage.py
@@ -20,9 +20,9 @@ wait_for_relation = 60*5
#########################################################
# 3shard cluster configuration
#########################################################
-d = amulet.Deployment(series='trusty')
+d = amulet.Deployment(series='xenial')
-d.add('mongodb', units=scale, series='trusty',
+d.add('mongodb', units=scale, series='xenial',
constraints={'root-disk': '20480M'})
d.add('storage', charm='cs:~chris-gondolin/trusty/storage-5', series='trusty')
d.configure('storage', {'provider': 'local'})
diff --git a/tests/50_relate_ceilometer_test.py b/tests/50_relate_ceilometer_test.py
index ef45166..52571d8 100755
--- a/tests/50_relate_ceilometer_test.py
+++ b/tests/50_relate_ceilometer_test.py
@@ -7,7 +7,7 @@ class TestDeploy(object):
def __init__(self, time=2500):
# Attempt to load the deployment topology from a bundle.
- self.deploy = amulet.Deployment(series="trusty")
+ self.deploy = amulet.Deployment(series="xenial")
# If something errored out, attempt to continue by
# manually specifying a standalone deployment