echo "start to run test"
echo "push file appA"
./dockyard client push "appv1#http://localhost:1234/n/r" "tests/integrate/testdata/osA/archA/appA" "osA/archA"
echo "--------------------------------"
echo "push file appB"
./dockyard client push "appv1#http://localhost:1234/n/r" "tests/integrate/testdata/osB/archB/appB" "osB/archB" "rsa"
echo "--------------------------------"
echo "list appA and appB"
./dockyard client list "appv1#http://localhost:1234/n/r"
echo "--------------------------------"
echo "pull appA"
./dockyard client pull "appv1#http://localhost:1234/n/r" "osA/archA/appA"
echo "--------------------------------"
echo "delete appA"
./dockyard client delete "appv1#http://localhost:1234/n/r" "osA/archA/appA"
echo "--------------------------------"
echo "list appB only"
./dockyard client list "appv1#http://localhost:1234/n/r"
echo "--------------------------------"
echo "pull appB"
./dockyard client pull "appv1#http://localhost:1234/n/r" "osB/archB/appB"
echo "--------------------------------"
echo "end of the test"

echo "--------------------------------"
echo "try to decrypt file, if not success, please check if the private key and appB file are in the right place"
./dockyard client decrypt "/tmp/containerops_keymanager_cache/app/v1/n/priv_key.pem" $HOME/.dockyard/cache/n/r/osB/archB/appB
diff tests/integrate/testdata/osB/archB/appB $HOME/.dockyard/cache/n/r/osB/archB/appB-decrypted
