mirror of
https://github.com/rancher/os.git
synced 2025-09-06 09:14:31 +00:00
Add a test for the non-tar b2d autoformat trigger
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
10
scripts/run
10
scripts/run
@@ -71,6 +71,10 @@ while [ "$#" -gt 0 ]; do
|
|||||||
--fresh)
|
--fresh)
|
||||||
FRESH=1
|
FRESH=1
|
||||||
;;
|
;;
|
||||||
|
--b2d)
|
||||||
|
# use together with --fresh to trigger boot2docker/machine auto-format
|
||||||
|
AUTOFORMAT=1
|
||||||
|
;;
|
||||||
--console)
|
--console)
|
||||||
# use the bios console, not serial (lets you see syslinux)
|
# use the bios console, not serial (lets you see syslinux)
|
||||||
CONSOLEDISPLAY=1
|
CONSOLEDISPLAY=1
|
||||||
@@ -126,10 +130,16 @@ if [ "$QEMU" == "1" ] || [ "$BOOT_ISO" == "1" ] || [ "$BOOT_HD" == "1" ]; then
|
|||||||
mkdir -p $(dirname ${HD})
|
mkdir -p $(dirname ${HD})
|
||||||
if [ ¨$INSTALLED¨ == ¨1¨ ]; then
|
if [ ¨$INSTALLED¨ == ¨1¨ ]; then
|
||||||
./scripts/create-installed
|
./scripts/create-installed
|
||||||
|
else
|
||||||
|
if [ "$AUTOFORMAT" == "1" ]; then
|
||||||
|
echo "boot2docker, please format-me" | cat - /dev/zero | head -c 5242880 > format-flag.txt # 5M
|
||||||
|
qemu-img convert -f raw format-flag.txt -O qcow2 ${HD}
|
||||||
|
qemu-img resize ${HD} +10GB
|
||||||
else
|
else
|
||||||
qemu-img create -f qcow2 -o size=10G ${HD}
|
qemu-img create -f qcow2 -o size=10G ${HD}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$SECOND_DRIVE" == "1" ]; then
|
if [ "$SECOND_DRIVE" == "1" ]; then
|
||||||
if [ "$FRESH" == "1" ]; then
|
if [ "$FRESH" == "1" ]; then
|
||||||
|
22
tests/boot2docker_autoformat_test.go
Executable file
22
tests/boot2docker_autoformat_test.go
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
package integration
|
||||||
|
|
||||||
|
import . "gopkg.in/check.v1"
|
||||||
|
|
||||||
|
func (s *QemuSuite) TestBoot2DockerState(c *C) {
|
||||||
|
s.RunQemu(c, "--fresh", "--b2d")
|
||||||
|
s.CheckCall(c, "blkid | grep B2D_STATE")
|
||||||
|
// And once I make run create a tar file, check that its untarred in the docker user's home dir
|
||||||
|
// And confirm if it should add to the dir, or replace, i can't remember
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *QemuSuite) TestIsoBoot2DockerState(c *C) {
|
||||||
|
s.RunQemu(c, "--fresh", "--b2d", "--iso")
|
||||||
|
s.CheckCall(c, "blkid | grep B2D_STATE")
|
||||||
|
// And once I make run create a tar file, check that its untarred in the docker user's home dir
|
||||||
|
// And confirm if it should add to the dir, or replace, i can't remember
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *QemuSuite) TestRancherOSState(c *C) {
|
||||||
|
s.RunQemu(c, "--fresh")
|
||||||
|
s.CheckCall(c, "blkid | grep RANCHER_STATE")
|
||||||
|
}
|
Reference in New Issue
Block a user