Skip to content

Commit

Permalink
Merge pull request #182 from scality/bugfix/ZENKO-699_Fix_Lifecycle_Test
Browse files Browse the repository at this point in the history
bug(zenko-699): Fix Lifecycle Test
  • Loading branch information
ssalaues committed Jul 12, 2018
2 parents cc01257 + bde1e7f commit 043e40c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 13 deletions.
5 changes: 5 additions & 0 deletions eve/ci-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ cloudserver-front:
orbit:
endpoint: "http://ciutil-orbit-simulator:4222"
mode: "poll"

backbeat:
lifecycle:
conductor:
cronRule: "0 */1 * * * *"
8 changes: 2 additions & 6 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ ifeq ($(ZENKO_PRESENT), build)
zenko-run: | simulator-run
@$(HELM) upgrade --install $(ZENKO_HELM_RELEASE) \
$(shell source $(DOTENV) && ../eve/workers/ci_env.sh set) \
--set prometheus.rbac.create=false \
--set zenko-queue.rbac.enabled=false \
--set redis-ha.rbac.create=false \
--set cloudserver-front.ci.enabled=true \
-f ../charts/single-node-values.yml \
../charts/zenko/ --wait --timeout 600
-f local-values.yml \
../charts/zenko/ --wait --timeout 1200
.PHONY: zenko-run
else
zenko-run: | simulator-run
Expand Down
75 changes: 75 additions & 0 deletions tests/local-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
nodeCount: &nodeCount 1

ingress:
enabled: true
hosts:
- ""

prometheus:
rbac:
create: false
serviceAccounts:
alertmanager:
name: default
create: false
nodeExporter:
name: default
create: false
kubeStateMetrics:
name: default
create: false
pushgateway:
name: default
create: false
server:
name: default
create: false

redis-ha:
rbac:
create: false
serviceAccount:
create: false
name: default
replicas:
servers: *nodeCount
sentinels: *nodeCount

cloudserver-front:
image:
pullPolicy: Always
orbit:
endpoint: "http://ciutil-orbit-simulator:4222"
mode: "poll"
mongodb:
replicas: *nodeCount


backbeat:
mongodb:
replicas: *nodeCount
lifecycle:
conductor:
cronRule: "0 */1 * * * *"

zenko-filer:
mongodb:
replicas: *nodeCount

zenko-queue:
rbac:
enabled: false
replicas: *nodeCount
kafkaHeapOptions: "-Xms256M"
configurationOverrides:
"offsets.topic.replication.factor": *nodeCount
"min.insync.replicas": *nodeCount

zenko-quorum:
replicaCount: *nodeCount
env:
ZK_HEAP_SIZE: "256M"

mongodb-replicaset:
replicaSet: rs0
replicas: *nodeCount
15 changes: 9 additions & 6 deletions tests/zenko_e2e/cloudserver/test_lifecycle.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import time

import pytest
import zenko_e2e.conf as conf

from datetime import datetime
from ..fixtures import *
from .. import conf


@pytest.mark.skip(reason='This test requires manual work to complete')
def test_expiration(expiring_bucket, testfile, objkey):
util.mark_test('LIFECYCLE EXPIRATION')
expiry, bucket = expiring_bucket # pylint: disable=unused-variable
bucket.put_object(
Body=testfile,
Key=objkey
)
wait_time = 0
now = datetime.utcnow()
if expiry > now:
wait_time = expiry - now
wait_time += conf.EXPIRY_INTERVAL
print('Waiting %i secs for lifecyle to run' % wait_time.total_seconds())
assert util.check_object(objkey, testfile, bucket)
time.sleep(conf.EXPIRY_DELTA.total_seconds() + 10)
time.sleep(wait_time.total_seconds())
assert not util.check_object(objkey, testfile, bucket)
3 changes: 2 additions & 1 deletion tests/zenko_e2e/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def baseurl(url):
}


EXPIRY_DELTA = timedelta(minutes=1)
EXPIRY_DELTA = timedelta(seconds=30)
EXPIRY_INTERVAL = timedelta(minutes=2)

EXPIRY_RULE = {
'Rules': [{
Expand Down

0 comments on commit 043e40c

Please sign in to comment.