Files
fission-src/test/tests/test_fn_update/test_poolmgr_nd.sh
T
VishalandGitHub a23f8acffc Tests for function update (#550)
Tests for updates to a function of new deployment executor type. Tests check for changes in the environment, scale, secrets etc. Also checks conversion of function executor type from new deployment to pool manager and vice versa
2018-03-28 20:32:04 +05:30

41 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
source $(dirname $0)/fnupdate_utils.sh
ROOT=$(dirname $0)/../../..
env=python-$(date +%N)
fn=hellopython-$(date +%N)
log "Creating Python env $env"
fission env create --name $env --image fission/python-env --mincpu 20 --maxcpu 100 --minmemory 128 --maxmemory 256
trap "fission env delete --name $env" EXIT
log "Creating function $fn"
fission fn create --name $fn --env $env --code $ROOT/examples/python/hello.py
log "Creating route"
fission route create --function $fn --url /$fn --method GET
log "Waiting for router to catch up"
sleep 5
timeout 60 bash -c "test_fn $fn 'world'"
log "Updating function $fn executor type to new deployment"
fission fn update --name $fn --env $env --code $ROOT/examples/python/hello.py --minscale 1 --maxscale 4 --executortype newdeploy
log "Waiting for router to catch up"
sleep 5
timeout 60 bash -c "test_fn $fn 'world'"
log "Updating function $fn executor type back to pool manager"
fission fn update --name $fn --env $env --code $ROOT/examples/python/hello.py --executortype poolmgr
log "Waiting for router to catch up"
sleep 5
timeout 60 bash -c "test_fn $fn 'world'"