Skip to content

Commit

Permalink
iQIcBAABAgAGBQJXl4IwAAoJECY9bfLhY+Hq+3AQAJIRku1Yo5/1rqPuFiYr2rlq
Browse files Browse the repository at this point in the history
 gaYQToQv5ILtvl6kukQUP8msJs4JtTDULkW7fQYPwCtjhmFTbFAOFSnj0j3fnz/Q
 sm8YNA2kdrtWYnbFTCR5EwA+nYoajim8OwZlVb6ewutGHpMeK6n+p9OVaTI06qfE
 ZMpkJTZPzr0zT1/ysSf8SYmQMqgMOO5Z9t32jFZEpedRKNmjEjhL+aNTi2Z6XX6E
 UfFYUGxBjoxkkWWSgY1zu6S6/Lq5C1vae5i+GzZc70OT2qE2i+lM9EM2JDdbiGZq
 INBZKllYfbjoQE0gPsbWEghMmBMsx0vw04NVV184oCyTBhnaog5NyXmvmNgZocKU
 ftUEK862t9S2MCBSg4gN0jenbQD/uhBBpRsfZFXbBwCQgiGkPC+XppN+FPAf27Ag
 SoK4WWw4whgLvCK4CwuYD7XyWryWq6JHZPpqvuXjBIT1vIwmm4WBR3TG8Lx0/1Jj
 Izc2hO2v+7USWjEAioDKYI7Kpllvnsb2fvvpxcWBDi7Q21pYxWXNJWZHmRYNpEZ6
 EYlmoAjoBEt1iomBfHMTuwKF0vUYM9EXZ+exkQXNnQ/lQXfRZODt4gZTKKNN9Exo
 6XU6RT5tZozsheKS+v0xDPWjSnlORySs8s+XrKa0KNOjM87pedwQDJcSJ3WYh7C2
 483/CSCFnGBW+bbhYGbI
 =tmNr
 -----END PGP SIGNATURE-----

Revert "Migrate script should now work since we are after docker-1.10"

It breaks the tests suite

This reverts commit 7fcd49e.

Closes: projectatomic#497
Approved by: jlebon
  • Loading branch information
giuseppe authored and rh-atomic-bot committed Jul 26, 2016
1 parent 4620f9f commit 1645062
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
34 changes: 14 additions & 20 deletions migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,18 @@ container_export(){
echo $containerBaseImageID>>containerInfo.txt
echo $notruncContainerID>>containerInfo.txt
"$GOTAR" -cf container-metadata.tar $dockerRootDir/containers/$notruncContainerID 2> /dev/null
if [[ ! -z $(docker diff $containerID) ]];then
imageName=$(echo $RANDOM)
docker commit $containerID $imageName 1>/dev/null||exit 1
mkdir -p $tmpDir/temp
docker save $imageName > $tmpDir/temp/image.tar||exit 1
$(cd $tmpDir/temp; "$GOTAR" -xf image.tar)
diffLayerID=$(python -c 'import json; f=open("temp/repositories"); j=json.load(f); print(j[j.keys()[0]]["latest"])')
cd $tmpDir/temp/$diffLayerID
cp layer.tar $tmpDir/container-diff.tar
cd $tmpDir
/usr/bin/tar --delete -f container-diff.tar run/gotar 2>/dev/null || true
rm -rf temp
docker rmi -f $imageName 1>/dev/null||exit 1
fi
imageName=$(echo $RANDOM)
docker commit $containerID $imageName 1>/dev/null||exit 1
mkdir -p $tmpDir/temp
docker save $imageName > $tmpDir/temp/image.tar||exit 1
$(cd $tmpDir/temp; "$GOTAR" -xf image.tar)
diffLayerID=$(python -c 'import json; f=open("temp/repositories"); j=json.load(f); print(j[j.keys()[0]]["latest"])')
cd $tmpDir/temp/$diffLayerID
cp layer.tar $tmpDir/container-diff.tar
cd $tmpDir
/usr/bin/tar --delete -f container-diff.tar run/gotar 2>/dev/null || true
rm -rf temp
docker rmi -f $imageName 1>/dev/null||exit 1
}

container_import(){
Expand Down Expand Up @@ -186,12 +184,8 @@ container_import(){
fi

cd $importPath/containers/migrate-$containerID
dockerBaseImageID=$(sed -n '2p' containerInfo.txt)||exit 1
if [[ -f container-diff.tar ]];then
cat container-diff.tar|docker run -i -v "$GOTAR:/run/gotar" $dockerBaseImageID /run/gotar -xf -
else
docker run -i $dockerBaseImageID echo "container_import"
fi
dockerBaseImageID=$(sed -n '2p' containerInfo.txt)||exit 1
cat container-diff.tar|docker run -i -v "$GOTAR:/run/gotar" $dockerBaseImageID /run/gotar -xf -
newContainerID=$(docker ps -lq)||exit 1
newContainerName=$(docker inspect -f '{{.Name}}' $newContainerID)||exit 1
newNotruncContainerID=$(docker ps -aq --no-trunc|grep $newContainerID)||exit 1
Expand Down
15 changes: 8 additions & 7 deletions tests/integration/test_migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
set -euo pipefail
IFS=$'\n\t'

#With the inclusion of this PR (https://github.com/projectatomic/atomic/pull/294)
#atomic storage export/import will only work with docker 1.10 support.
#Skip this test, until we move to docker 1.10.

echo "WARNING: skipping test_migrate.sh since it is only supported with docker 1.10 onwards."
exit 0

#
# 'atomic storage' integration tests (non-live)
# AUTHOR: Shishir Mahajan <shishir dot mahajan at redhat dot com>
Expand All @@ -18,13 +25,7 @@ if [ "$init" != "systemd" ];then
exit 0
fi

if ! systemctl is-active docker >/dev/null; then
echo "Docker daemon is not running"
exit 1
fi

pid=$(systemctl show -p MainPID docker.service)
dockerPid=$(echo ${pid#*=})
dockerPid=$(ps -C docker -o pid=|xargs)
dockerCmdline=$(cat /proc/$dockerPid/cmdline)
if [[ $dockerCmdline =~ "-g=" ]] || [[ $dockerCmdline =~ "-g/" ]] || [[ $dockerCmdline =~ "--graph" ]];then
echo "Docker is not located at the default (/var/lib/docker) root location. Skipping these tests."
Expand Down
4 changes: 4 additions & 0 deletions tests/test-images/Dockerfile.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
MAINTAINER "William Temple <wtemple at redhat dot com>"

LABEL "Name"="atomic-test-2"

0 comments on commit 1645062

Please sign in to comment.