Fix gate issues with functional-api job

Prevents etcdctl from hanging when etcd has not started by explictly
specifying connection timeouts.
Reduce swarm build time by removing the unneccessary dependency
between masters and nodes.
Only create 1 node instead of 2 nodes
Remove test_update_bay_name_for_existing_bay

Change-Id: If6724497b47247d2858b6da90309949f92314cfb
Closes-Bug: 1541105
changes/94/275994/3
Corey O'Brien 7 years ago
parent 547780e22b
commit 1a9806b17f
  1. 6
      magnum/templates/swarm/fragments/write-swarm-agent-service.sh
  2. 1
      magnum/templates/swarm/swarmcluster.yaml
  3. 21
      magnum/tests/functional/api/v1/test_bay.py

@ -41,7 +41,11 @@ SCRIPT=/usr/local/bin/notify-heat
cat > $SCRIPT << EOF
#!/bin/sh
until etcdctl --peers $ETCD_SERVER_IP:2379 ls /v2/keys/swarm/docker/swarm/nodes/$myip:2375
until etcdctl \
--peers $ETCD_SERVER_IP:2379 \
--timeout 1s \
--total-timeout 5s \
ls /v2/keys/swarm/docker/swarm/nodes/$myip:2375
do
echo "Waiting for swarm agent registration..."
sleep 5

@ -299,7 +299,6 @@ resources:
type: "OS::Heat::ResourceGroup"
depends_on:
- extrouter_inside
- swarm_masters
properties:
count: {get_param: number_of_nodes}
resource_def:

@ -106,7 +106,8 @@ class BayTest(base.BaseMagnumTest):
# they time out on the gate (2 hours not enough)
@testtools.testcase.attr('positive')
def test_create_list_and_delete_bays(self):
gen_model = datagen.valid_bay_data(baymodel_id=self.baymodel.uuid)
gen_model = datagen.valid_bay_data(
baymodel_id=self.baymodel.uuid, node_count=1)
_, temp_model = self._create_bay(gen_model)
resp, model = self.bay_client.list_bays()
self.assertEqual(resp.status, 200)
@ -139,24 +140,6 @@ class BayTest(base.BaseMagnumTest):
exceptions.BadRequest,
self.bay_client.post_bay, gen_model)
@testtools.testcase.attr('negative')
def test_update_bay_baymodel_name_for_existing_bay(self):
first_model = datagen.valid_bay_data(baymodel_id=self.baymodel.uuid,
name='test')
_, old_model = self._create_bay(first_model)
patch_model = datagen.bay_name_patch_data()
self.assertRaises(
exceptions.BadRequest,
self.bay_client.patch_bay,
old_model.uuid, patch_model)
patch_baymodel = datagen.baymodel_name_patch_data()
self.assertRaises(
exceptions.BadRequest,
self.baymodel_client.patch_baymodel,
self.baymodel.uuid, patch_baymodel)
@testtools.testcase.attr('negative')
def test_update_bay_for_nonexisting_bay(self):
patch_model = datagen.bay_name_patch_data()

Loading…
Cancel
Save