Project

Profile

Help

Task #7727

Updated by Ilfat Kinyaev over 4 years ago

https://github.com/OSLL/mdbci/tree/7727_robust_machine_cleaning
https://github.com/OSLL/mdbci/pull/322

!! For remove only first match - use flag "-o" as second argument of script.

Tests cases:

1) Libvirt snapshot's delete:
# Up config, create snapshots, snapshot, run script.

./mdbci --template confs/libvirt_lite.json generate SOME_DIR

./mdbci up SOME_DIR/node0

./mdbci snapshot take --path-to-nodes SOME_DIR --node-name node0 --snapshot-name SNAP_NAME

# As result, script will delete all snapshots:
./scripts/clean_vms.sh SOME_DIR_node0

2) Destroy only first match config of ALL PROVIDERS:

# Up several configs,take snapshot, run script.
./mdbci --template confs/libvirt_lite.json generate SOME_DIR
./mdbci --template confs/docker_lite.json generate SOME_DIR2

./mdbci up SOME_DIR/node0
./mdbci up SOME_DIR2/node0

./mdbci snapshot take --path-to-nodes SOME_DIR --node-name node0 --snapshot-name SNAP_NAME

./mdbci snapshot take --path-to-nodes SOME_DIR2 --node-name node0 --snapshot-name SNAP_NAME

# As result, script will delete first match config:
./scripts/clean_vms.sh SOME_DIR -o

3) Destroy only first match config of specified provider:

# Up several configs,take snapshot, run script.
./mdbci --template confs/libvirt_lite.json generate SOME_DIR
./mdbci --template confs/docker_lite.json generate SOME_DIR2

./mdbci up SOME_DIR/node0
./mdbci up SOME_DIR2/node0

./mdbci snapshot take --path-to-nodes SOME_DIR --node-name node0 --snapshot-name SNAP_NAME

./mdbci snapshot take --path-to-nodes SOME_DIR2 --node-name node0 --snapshot-name SNAP_NAME

# As result, script will delete first match config - SOME_DIR_node0:
./scripts/clean_vms.sh SOME_DIR -o

# SOME_DIR2_node0 will still alive.



Back