I'm writing an install script for an appliance that modifies system config files under /etc (amongst other things). How can I test this script non-destructively?Ideally I would like to run the script in a pseudo-sandbox that provides a layer over the existing filesystem, and then see examine any changed files afterwards.I'm not worried about the script being intentionally malicious, but would like to protect against system files being modified or deleted in any way.
Automated test for install script
linux;chroot;testing;sandbox
You could use Docker to create an OS in a container image, then run the install script in the activated container. Afterwards you can use the docker diff command to see what files it changed in the container. The container is isolated from the host, so your real /etc files would be unaffected.