The testing framework basically aims to run the create and deploy tools in a controlled environment to check for any regressions during code changes and refactoring. This are the rules of the test club: - For each new feature there should be a unit test - For each bug fixed there should be a unit test Running the test suite ---------------------- You need to change to the tests directory and execute run_tests.sh: $ ./run_tests.sh To run each test individually: $ ./00_my_individual_test.sh ../path/to/test-create ../path/to/test-deploy Anatomy of a unit test ---------------------- Each test needs to copy the following boilerplate: #!/bin/bash TEST_ID="01" TEST_NAME="My unit test" CREATE=`pwd`/$1 DEPLOY=`pwd`/$2 TEST_TOOLS=$3 . ./test_lib.sh ############# Test specific code ############ function setup { } function check_results { } ############################################# main $@ Test lib is a bash function library that sets up the environment for the test. To create a test, we have two main variables $ORIGIN and $TARGET which are the origin and target directories of the diff respectively. The setup function should populate the origin and the target directories for the diff test. This is an example of a simple file difference test. It takes into account both contents and metadata (mtime, ownership and permissions): ORG_FILE=$ORIGIN/b.txt TGT_FILE=$TARGET/b.txt function setup { echo 1 > $ORG_FILE && \ echo 2 > $TGT_FILE && \ chown :cdrom $TGT_FILE && \ chmod 707 $TGT_FILE } function check_results { check_content $ORG_FILE "2" && \ check_perm $ORG_FILE 707 && \ check_group $ORG_FILE cdrom && \ check_same_mtime $ORG_FILE $TGT_FILE }