Create function that creates clone of docker machine/node by its name
./mdbci --template spec/test_machine_configurations/7143_test_config generate docker_ubuntu_test
./mdbci up docker_ubuntu_test
Run test (execute in shell)
path_to_nodes=docker_ubuntu_test node_name=node0 path_to_new_config_directory=new_docker_ubuntu_test rspec spec/unit/7143_clone_docker_node.rb
- path to nodes(relative path in mdbci/ folder)
- node name (like: node0)
- path to new config directory (like: NEW_CONF_T)
How to make docker image clone is described here: https://linuxconfig.org/docker-container-backup-and-recovery.
Cloned machine should have generated name from two variable: new config directory name and node name, devided by underscore (like NEW_CONF_T_node0)
Function must throw exception if node or config directory or node are not found.
Function must throw exception if machine origin is in running state.
Function must be implemented in file clone.rb in core/ directory
Function returns new docker image name