Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On a terminal do the following

  1. Download and install minikube on linux
  2. minikube config set driver docker
  3. 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

  1. copy pom.xml to /git/docker/policy-db-migrator
  2. cd /git/docker/policy-db-migrator
  3. eval $(minikube -p minikube docker-env)
  4. mvn clean install (this will install the db-migrator image to minikube docker)
  5. ssh -i $(minikube ssh-key) docker@$(minikube ip)
  6. docker images – you should see the onap/policy-db-migrator image
  7. exit out of minikube
  8. kubectl create -f db.yaml
  9. kubectl get pods
  10. kubectl logs <db-migrator image name>
  11. kubectl delete -f db.yaml
  12. 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.

...