@@ -5,11 +5,9 @@ function finish {
55 result=$?
66 if [ $result -ne 0 ]; then
77 echo ' ----- APP LOGS ------'
8- docker logs $( docker ps -l -f " ancestor=cpfix_app " --format=" {{.ID}}" )
8+ docker logs $( docker ps -l -f " ancestor=cpfix2_app " --format=" {{.ID}}" )
99 echo ' ---------------------'
1010 fi
11- # clean up after the test
12- sed -i ' s/arg2/arg1/' ./containerpilot.json
1311 exit $result
1412}
1513trap finish EXIT
@@ -20,32 +18,32 @@ docker-compose up -d
2018docker-compose run --no-deps test /go/bin/test_probe test_consul > /dev/null 2>&1
2119if [ ! $? -eq 0 ] ; then exit 1 ; fi
2220
23- ID=$( docker ps -l -f " ancestor=cpfix_app " --format=" {{.ID}}" )
21+ ID=$( docker ps -l -f " ancestor=cpfix2_app " --format=" {{.ID}}" )
2422
2523# verify the coprocess is running
26- docker exec -it ${ID} ps -ef | grep coprocess
24+ docker exec -it " $ID " ps -ef | grep coprocess
2725
2826# kill the coprocess and verify it restarts
29- docker exec -it ${ID} pkill coprocess
27+ docker exec -it " $ID " pkill coprocess
3028sleep 1
31- docker exec -it ${ID} ps -ef | grep coprocess
29+ docker exec -it " $ID " ps -ef | grep coprocess
3230
3331# kill the coprocess and verify it doesn't restart again
34- docker exec -it ${ID} pkill coprocess
32+ docker exec -it " $ID " pkill coprocess
3533sleep 1
3634
3735set +e
38- docker exec -it ${ID} ps -ef | grep coprocess && exit 1
36+ docker exec -it " $ID " ps -ef | grep coprocess && exit 1
3937set +e
4038
4139# update the ContainerPilot config and verify the coprocess is running
4240# with the new flags (this resets the restart limit)
43- sed -i ' s/arg1/arg2/' ./containerpilot .json
44- docker exec -it ${ID} kill -SIGHUP 1
41+ docker exec -it " $ID " sed -i ' s/arg1/arg2/' /app-with-coprocess .json
42+ docker exec -it " $ID " kill -SIGHUP 1
4543sleep 1
46- docker exec -it ${ID} ps -ef | grep coprocess | grep arg2
44+ docker exec -it " $ID " ps -ef | grep coprocess | grep arg2
4745
4846# kill the coprocess and verify it restarts
49- docker exec -it ${ID} pkill coprocess
47+ docker exec -it " $ID " pkill coprocess
5048sleep 1
51- docker exec -it ${ID} ps -ef | grep coprocess
49+ docker exec -it " $ID " ps -ef | grep coprocess
0 commit comments