...
On a terminal do the following
- Download and install minikube on linux
- minikube config set driver docker
- minikube start -- mount -- mount-string ="/git/docker:/mnt" (that's where docker repo was cloned)
/git/docker/policy-db-migrator/src/main/docker folder should contain the following files: db-migrator, drools_policy_init.sh, prepare_downgrade.sh and prepare_upgrade.sh
- copy pom.xml to /git/docker/policy-db-migrator
- cd /git/docker/policy-db-migrator
- eval $(minikube -p minikube docker-env)
- mvn clean install (this will install the db-migrator image to minikube docker)
- ssh -i $(minikube ssh-key) docker@$(minikube ip)
- docker images – you should see the onap/policy-db-migrator image
- exit out of minikube
- kubectl create -f db.yaml
- kubectl get pods
- kubectl logs <db-migrator image name>
- kubectl delete -f db.yaml
- minikube stop
Test scenarios:
- Fresh install Honolulu
...
Command: /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade -t honolulu0800
Expected result: schema is created and populated with tables and indexes.
...
- Upgrade Istanbul to Honolulu (fail scenario) (need to confirm if target is by number)
Command: /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade -t 0800 -f 0900
DB migrator should fail when upgrading to a down version.
...
DB migrator should fail when downgrading to an upper version.
Command: /opt/app/policy/bin/db-migrator -s policyadmin -o downgrade -t 0900 -f 0800
Expected result: no changes on database, script has error result.
...
DB migrator should change tables and indexes based on Honolulu downgrade scripts.
Command: /opt/app/policy/bin/db-migrator -s policyadmin -o downgrade -t 0800
Expected result: tables and indexes are all dropped.
...