Compare commits
25 Commits
v0.8.0-rc3
...
v0.8.0-rc6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
569811d1f0 | ||
|
|
8d3dc7bede | ||
|
|
61191056a7 | ||
|
|
65c794ea67 | ||
|
|
1b8d869199 | ||
|
|
27b07dab5a | ||
|
|
4e433c272f | ||
|
|
529c1ec83b | ||
|
|
a4e77692c4 | ||
|
|
1c5d41a56e | ||
|
|
48acef5336 | ||
|
|
cf1ddf2ff8 | ||
|
|
b79173c272 | ||
|
|
3a7096f19b | ||
|
|
353fa604ab | ||
|
|
9670aa8505 | ||
|
|
0ec9c2c0e0 | ||
|
|
f906142534 | ||
|
|
a9f19b7d1d | ||
|
|
1be5c6c527 | ||
|
|
ac761a3973 | ||
|
|
ff32d2d34c | ||
|
|
fc1e4e060d | ||
|
|
7765a3308d | ||
|
|
8e5eba0ac5 |
@@ -56,7 +56,7 @@ ARG DOCKER_BUILD_VERSION=1.10.3
|
||||
ARG DOCKER_BUILD_PATCH_VERSION=v${DOCKER_BUILD_VERSION}-ros1
|
||||
ARG SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.3/policy.29
|
||||
|
||||
ARG KERNEL_VERSION_amd64=4.9.4-rancher
|
||||
ARG KERNEL_VERSION_amd64=4.9.5-rancher
|
||||
ARG KERNEL_URL_amd64=https://github.com/rancher/os-kernel/releases/download/v${KERNEL_VERSION_amd64}/linux-${KERNEL_VERSION_amd64}-x86.tar.gz
|
||||
ARG KERNEL_URL_arm64=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.4.0-arm64.8/linux-4.4.0-rancher-arm64.tar.gz
|
||||
|
||||
|
||||
3
Makefile
3
Makefile
@@ -34,6 +34,9 @@ shell-bind: .dapper
|
||||
clean:
|
||||
@./scripts/clean
|
||||
|
||||
itest:
|
||||
./.dapper integration-test 2>&1 | tee dist/itest.log
|
||||
|
||||
help:
|
||||
@./scripts/help
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import (
|
||||
"github.com/coreos/coreos-cloudinit/pkg"
|
||||
"github.com/docker/docker/pkg/mount"
|
||||
"github.com/rancher/os/cmd/cloudinitsave/gce"
|
||||
"github.com/rancher/os/cmd/control"
|
||||
"github.com/rancher/os/cmd/network"
|
||||
rancherConfig "github.com/rancher/os/config"
|
||||
"github.com/rancher/os/log"
|
||||
@@ -57,6 +58,10 @@ func Main() {
|
||||
log.InitLogger()
|
||||
log.Info("Running cloud-init-save")
|
||||
|
||||
if err := control.UdevSettle(); err != nil {
|
||||
log.Errorf("Failed to run udev settle: %v", err)
|
||||
}
|
||||
|
||||
cfg := rancherConfig.LoadConfig()
|
||||
network.ApplyNetworkConfig(cfg)
|
||||
|
||||
|
||||
@@ -15,12 +15,15 @@ import (
|
||||
)
|
||||
|
||||
func bootstrapAction(c *cli.Context) error {
|
||||
log.Debugf("bootstrapAction")
|
||||
if err := UdevSettle(); err != nil {
|
||||
log.Errorf("Failed to run udev settle: %v", err)
|
||||
}
|
||||
|
||||
log.Debugf("bootstrapAction: loadingConfig")
|
||||
cfg := config.LoadConfig()
|
||||
|
||||
log.Debugf("bootstrapAction: MdadmScan(%v)", cfg.Rancher.State.MdadmScan)
|
||||
if cfg.Rancher.State.MdadmScan {
|
||||
if err := mdadmScan(); err != nil {
|
||||
log.Errorf("Failed to run mdadm scan: %v", err)
|
||||
@@ -28,12 +31,14 @@ func bootstrapAction(c *cli.Context) error {
|
||||
}
|
||||
|
||||
stateScript := cfg.Rancher.State.Script
|
||||
log.Debugf("bootstrapAction: stateScript(%v)", stateScript)
|
||||
if stateScript != "" {
|
||||
if err := runStateScript(stateScript); err != nil {
|
||||
log.Errorf("Failed to run state script: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("bootstrapAction: RunCommandSequence(%v)", cfg.Bootcmd)
|
||||
util.RunCommandSequence(cfg.Bootcmd)
|
||||
|
||||
if cfg.Rancher.State.Dev != "" && cfg.Rancher.State.Wait {
|
||||
@@ -41,12 +46,14 @@ func bootstrapAction(c *cli.Context) error {
|
||||
}
|
||||
|
||||
autoformatDevices := cfg.Rancher.State.Autoformat
|
||||
log.Debugf("bootstrapAction: Autoformat(%v)", cfg.Rancher.State.Autoformat)
|
||||
if len(autoformatDevices) > 0 {
|
||||
if err := autoformat(autoformatDevices); err != nil {
|
||||
log.Errorf("Failed to run autoformat: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("bootstrapAction: udev settle2")
|
||||
if err := UdevSettle(); err != nil {
|
||||
log.Errorf("Failed to run udev settle: %v", err)
|
||||
}
|
||||
|
||||
@@ -33,6 +33,12 @@ type symlink struct {
|
||||
func consoleInitAction(c *cli.Context) error {
|
||||
cfg := config.LoadConfig()
|
||||
|
||||
// Now that we're booted, stop writing debug messages to the console
|
||||
cmd := exec.Command("sudo", "dmesg", "--console-off")
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
if _, err := os.Stat(rancherHome); os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(rancherHome, 0755); err != nil {
|
||||
log.Error(err)
|
||||
@@ -85,8 +91,8 @@ func consoleInitAction(c *cli.Context) error {
|
||||
{"/var/lib/rancher/engine/dockerd", "/usr/bin/dockerd"},
|
||||
{"/var/lib/rancher/engine/docker-proxy", "/usr/bin/docker-proxy"},
|
||||
{"/var/lib/rancher/engine/docker-runc", "/usr/bin/docker-runc"},
|
||||
{"/usr/share/rancher/os-release", "/usr/lib/os-release"},
|
||||
{"/usr/share/rancher/os-release", "/etc/os-release"},
|
||||
{"/usr/share/ros/os-release", "/usr/lib/os-release"},
|
||||
{"/usr/share/ros/os-release", "/etc/os-release"},
|
||||
} {
|
||||
syscall.Unlink(link.newname)
|
||||
if err := os.Symlink(link.oldname, link.newname); err != nil {
|
||||
@@ -96,7 +102,7 @@ func consoleInitAction(c *cli.Context) error {
|
||||
|
||||
// font backslashes need to be escaped for when issue is output! (but not the others..)
|
||||
if err := ioutil.WriteFile("/etc/issue", []byte(`
|
||||
, , ______ _ _____ _____
|
||||
, , ______ _ _____ _____TM
|
||||
,------------|'------'| | ___ \\ | | / _ / ___|
|
||||
/ . '-' |- | |_/ /__ _ _ __ ___| |__ ___ _ __ | | | \\ '--.
|
||||
\\/| | | | // _' | '_ \\ / __| '_ \\ / _ \\ '__' | | | |'--. \\
|
||||
@@ -104,12 +110,12 @@ func consoleInitAction(c *cli.Context) error {
|
||||
| | | | \\_| \\_\\__,_|_| |_|\\___|_| |_|\\___|_| \\___/\\____/
|
||||
\\___/ \\___/ \s \r
|
||||
|
||||
RancherOS \n \l
|
||||
RancherOS `+config.Version+` \n \l
|
||||
`), 0644); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("bash", "-c", `echo $(/sbin/ifconfig | grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3}') >> /etc/issue`)
|
||||
cmd = exec.Command("bash", "-c", `echo $(/sbin/ifconfig | grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3}') >> /etc/issue`)
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
@@ -74,6 +74,10 @@ var installCommand = cli.Command{
|
||||
Name: "kexec",
|
||||
Usage: "reboot using kexec",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "debug",
|
||||
Usage: "Run installer with debug output",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -81,6 +85,13 @@ func installAction(c *cli.Context) error {
|
||||
if c.Args().Present() {
|
||||
log.Fatalf("invalid arguments %v", c.Args())
|
||||
}
|
||||
|
||||
if c.Bool("debug") {
|
||||
originalLevel := log.GetLevel()
|
||||
defer log.SetLevel(originalLevel)
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
kappend := strings.TrimSpace(c.String("append"))
|
||||
force := c.Bool("force")
|
||||
kexec := c.Bool("kexec")
|
||||
@@ -143,7 +154,7 @@ func runInstall(image, installType, cloudConfig, device, kappend string, force,
|
||||
fmt.Printf("Installing from %s\n", image)
|
||||
|
||||
if !force {
|
||||
if !yes("Continue") {
|
||||
if util.IsRunningInTty() && !yes("Continue") {
|
||||
log.Infof("Not continuing with installation due to user not saying 'yes'")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -171,7 +172,7 @@ func readCmdline() map[interface{}]interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Debugf("Config cmdline %s", cmdLine)
|
||||
//log.Debugf("Config cmdline %s", cmdLine)
|
||||
|
||||
cmdLineObj := parseCmdline(strings.TrimSpace(util.UnescapeKernelParams(string(cmdLine))))
|
||||
|
||||
@@ -219,6 +220,10 @@ func WriteToFile(data interface{}, filename string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(filepath.Dir(filename), os.ModeDir|0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return util.WriteFileAtomic(filename, content, 400)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
|
||||
func bootstrapServices(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
if util.ResolveDevice(cfg.Rancher.State.Dev) != "" && len(cfg.Bootcmd) == 0 {
|
||||
log.Info("NOT Running Bootstrap")
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
log.Info("Running Bootstrap")
|
||||
@@ -56,6 +58,8 @@ func stopDocker(c chan interface{}) error {
|
||||
|
||||
func bootstrap(cfg *config.CloudConfig) error {
|
||||
log.Info("Launching Bootstrap Docker")
|
||||
log.Infof("bootstrap container: Autoformat(%v)", cfg.Rancher.State.Autoformat)
|
||||
|
||||
c, err := startDocker(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
15
init/init.go
15
init/init.go
@@ -267,7 +267,17 @@ func RunInit() error {
|
||||
}
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
// save here so the bootstrap service can see it (when booting from iso, its very early)
|
||||
if boot2DockerEnvironment {
|
||||
if err := config.Set("rancher.state.dev", cfg.Rancher.State.Dev); err != nil {
|
||||
log.Errorf("Failed to update rancher.state.dev: %v", err)
|
||||
}
|
||||
if err := config.Set("rancher.state.autoformat", cfg.Rancher.State.Autoformat); err != nil {
|
||||
log.Errorf("Failed to update rancher.state.autoformat: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return config.LoadConfig(), nil
|
||||
},
|
||||
func(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
var err error
|
||||
@@ -278,9 +288,6 @@ func RunInit() error {
|
||||
return cfg, nil
|
||||
},
|
||||
func(cfg *config.CloudConfig) (*config.CloudConfig, error) {
|
||||
if err := os.MkdirAll(config.CloudConfigDir, os.ModeDir|0755); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
cfg.Rancher.CloudInit.Datasources = config.LoadConfigWithPrefix(state).Rancher.CloudInit.Datasources
|
||||
if err := config.Set("rancher.cloud_init.datasources", cfg.Rancher.CloudInit.Datasources); err != nil {
|
||||
|
||||
@@ -46,6 +46,13 @@ func SetLevel(level Level) {
|
||||
}
|
||||
}
|
||||
|
||||
func GetLevel() Level {
|
||||
if userHook != nil {
|
||||
return Level(userHook.Level)
|
||||
}
|
||||
return Level(appLog.Level)
|
||||
}
|
||||
|
||||
func Debugf(format string, args ...interface{}) {
|
||||
appLog.Debugf(format, args...)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
runcmd:
|
||||
- [ sudo, dmesg, --console-off ]
|
||||
rancher:
|
||||
environment:
|
||||
VERSION: {{.VERSION}}
|
||||
SUFFIX: {{.SUFFIX}}
|
||||
defaults:
|
||||
hostname: {{.HOSTNAME_DEFAULT}}
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
docker:
|
||||
engine: docker-1.12.6
|
||||
{{else -}}
|
||||
docker:
|
||||
engine: docker-1.11.2
|
||||
{{end -}}
|
||||
network:
|
||||
dns:
|
||||
nameservers: [8.8.8.8, 8.8.4.4]
|
||||
@@ -27,6 +30,7 @@ rancher:
|
||||
- /lib/firmware:/lib/firmware
|
||||
- /usr/bin/ros:/usr/bin/ros:ro
|
||||
- /usr/share/ros:/usr/share/ros:ro
|
||||
- /var/lib/rancher:/var/lib/rancher:ro
|
||||
cloud_init_services:
|
||||
cloud-init:
|
||||
image: {{.OS_REPO}}/os-base:{{.VERSION}}{{.SUFFIX}}
|
||||
@@ -126,7 +130,6 @@ rancher:
|
||||
read_only: true
|
||||
volumes:
|
||||
- /usr/bin/ros:/usr/bin/ros:ro
|
||||
- /usr/share/rancher:/usr/share/rancher:ro
|
||||
console:
|
||||
image: {{.OS_REPO}}/os-console:{{.VERSION}}{{.SUFFIX}}
|
||||
command: ros console-init
|
||||
@@ -276,7 +279,11 @@ rancher:
|
||||
- /home:/home
|
||||
- /opt:/opt
|
||||
docker:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
image: {{.OS_REPO}}/os-docker:1.12.6{{.SUFFIX}}
|
||||
{{else -}}
|
||||
image: {{.OS_REPO}}/os-docker:1.11.2{{.SUFFIX}}
|
||||
{{end -}}
|
||||
command: ros user-docker
|
||||
environment:
|
||||
- HTTP_PROXY
|
||||
@@ -314,7 +321,11 @@ rancher:
|
||||
url: {{.OS_RELEASES_YML}}/releases{{.SUFFIX}}.yml
|
||||
image: {{.OS_REPO}}/os
|
||||
docker:
|
||||
{{if eq "amd64" .ARCH -}}
|
||||
engine: docker-1.12.6
|
||||
{{else -}}
|
||||
engine: docker-1.11.2
|
||||
{{end -}}
|
||||
storage_driver: overlay
|
||||
group: docker
|
||||
host: ["unix:///var/run/docker.sock"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 console=tty0 console=ttyS0 ${APPEND}
|
||||
APPEND rancher.autologin=tty1 rancher.autologin=ttyS0 console=tty0 console=ttyS0 printk.devkmsg=on ${APPEND}
|
||||
|
||||
@@ -19,5 +19,13 @@ COPY ./build/ros /bin/
|
||||
|
||||
RUN ln -s /bootiso/boot/ /dist
|
||||
|
||||
# need to make a /scripts/set-disk-partitions so that older releases can call the installer
|
||||
RUN echo "#!/bin/sh" > /scripts/set-disk-partitions \
|
||||
&& echo "echo 'set-disk-partitions deprecated'" >> /scripts/set-disk-partitions \
|
||||
&& chmod 755 /scripts/set-disk-partitions
|
||||
|
||||
# work around some really weird ros symptoms
|
||||
RUN rm -rf /sbin/poweroff /sbin/shutdown /sbin/reboot /sbin/halt /usr/sbin/poweroff /usr/sbin/shutdown /usr/sbin/reboot /usr/sbin/halt
|
||||
|
||||
ENTRYPOINT ["/bin/ros", "install"]
|
||||
|
||||
|
||||
@@ -4,6 +4,4 @@ FROM rancher/os-installer
|
||||
RUN rm /dist/ \
|
||||
&& mkdir -p /dist/
|
||||
|
||||
#COPY ./ros /bin/
|
||||
COPY ./boot/ /dist/
|
||||
|
||||
|
||||
@@ -27,6 +27,19 @@ ln -s ros ${INITRD_DIR}/usr/bin/docker-runc
|
||||
ln -s ../../../../usr/bin/ros ${INITRD_DIR}/usr/var/lib/cni/bin/bridge
|
||||
ln -s ../../../../usr/bin/ros ${INITRD_DIR}/usr/var/lib/cni/bin/host-local
|
||||
|
||||
cat <<HERE > ${INITRD_DIR}/usr/share/ros/os-release
|
||||
NAME="RancherOS"
|
||||
VERSION=${VERSION}
|
||||
ID=rancheros
|
||||
ID_LIKE=
|
||||
VERSION_ID=${VERSION}
|
||||
PRETTY_NAME="RancherOS ${VERSION}"
|
||||
HOME_URL="http://rancher.com/rancher-os/"
|
||||
SUPPORT_URL="https://forums.rancher.com/c/rancher-os"
|
||||
BUG_REPORT_URL="https://github.com/rancher/os/issues"
|
||||
BUILD_ID=
|
||||
HERE
|
||||
|
||||
# Support upgrades from old persistent consoles that bind mount these
|
||||
touch ${INITRD_DIR}/usr/bin/docker-containerd
|
||||
touch ${INITRD_DIR}/usr/bin/docker-containerd-shim
|
||||
|
||||
@@ -22,26 +22,6 @@ if [ "$(docker info | grep 'Storage Driver: ' | sed 's/Storage Driver: //')" !=
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p ${INITRD_DIR}/usr/share/rancher/
|
||||
cat <<HERE > ${INITRD_DIR}/usr/share/rancher/os-release
|
||||
NAME="RancherOS"
|
||||
VERSION=${VERSION}
|
||||
ID=rancheros
|
||||
ID_LIKE=
|
||||
VERSION_ID=${VERSION}
|
||||
PRETTY_NAME="RancherOS ${VERSION}"
|
||||
HOME_URL="http://rancher.com/rancher-os/"
|
||||
SUPPORT_URL="https://forums.rancher.com/c/rancher-os"
|
||||
BUG_REPORT_URL="https://github.com/rancher/os/issues"
|
||||
BUILD_ID=
|
||||
HERE
|
||||
|
||||
# need to make relative links to the os-release file
|
||||
mkdir -p ${INITRD_DIR}/usr/lib
|
||||
cd ${INITRD_DIR}/usr/lib
|
||||
ln -s ../share/rancher/os-release os-release
|
||||
cd $(dirname $0)/..
|
||||
|
||||
DFS=$(docker run -d --privileged -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) ${DFS_IMAGE}${SUFFIX} ${DFS_ARGS})
|
||||
trap "docker rm -fv ${DFS_ARCH} ${DFS}" EXIT
|
||||
docker exec -i ${DFS} docker load < ${INITRD_DIR}/usr/share/ros/images.tar
|
||||
|
||||
20
scripts/run
20
scripts/run
@@ -6,6 +6,8 @@ cd $(dirname $0)/..
|
||||
|
||||
source ./scripts/run-common
|
||||
|
||||
MEMORY=2048
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case $1 in
|
||||
--iso)
|
||||
@@ -24,6 +26,10 @@ while [ "$#" -gt 0 ]; do
|
||||
shift 1
|
||||
QEMU_APPEND="${QEMU_APPEND} $1"
|
||||
;;
|
||||
--memory)
|
||||
shift 1
|
||||
MEMORY="$1"
|
||||
;;
|
||||
--name)
|
||||
shift 1
|
||||
NAME="$1"
|
||||
@@ -65,6 +71,10 @@ while [ "$#" -gt 0 ]; do
|
||||
--fresh)
|
||||
FRESH=1
|
||||
;;
|
||||
--b2d)
|
||||
# use together with --fresh to trigger boot2docker/machine auto-format
|
||||
AUTOFORMAT=1
|
||||
;;
|
||||
--console)
|
||||
# use the bios console, not serial (lets you see syslinux)
|
||||
CONSOLEDISPLAY=1
|
||||
@@ -121,7 +131,13 @@ if [ "$QEMU" == "1" ] || [ "$BOOT_ISO" == "1" ] || [ "$BOOT_HD" == "1" ]; then
|
||||
if [ ¨$INSTALLED¨ == ¨1¨ ]; then
|
||||
./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
|
||||
qemu-img create -f qcow2 -o size=10G ${HD}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -182,7 +198,7 @@ if [ "$QEMU" == "1" ]; then
|
||||
${KVM_ENABLE} \
|
||||
${CPU} \
|
||||
${machine["$ARCH"]} \
|
||||
-m 2048 \
|
||||
-m $MEMORY \
|
||||
${network["$ARCH"]} \
|
||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||
${SECOND_DRIVE_ENABLE} \
|
||||
@@ -211,7 +227,7 @@ elif [ "$BOOT_ISO" == "1" ] ||
|
||||
${KVM_ENABLE} \
|
||||
${CPU} \
|
||||
${machine["$ARCH"]} \
|
||||
-m 2048 \
|
||||
-m MEMORY \
|
||||
${network["$ARCH"]} \
|
||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||
${SECOND_DRIVE_ENABLE} \
|
||||
|
||||
26
tests/boot2docker_autoformat_test.go
Executable file
26
tests/boot2docker_autoformat_test.go
Executable file
@@ -0,0 +1,26 @@
|
||||
package integration
|
||||
|
||||
import . "gopkg.in/check.v1"
|
||||
|
||||
// NOTE: the boot2docker magic string/tar file is also used by Docker-machine
|
||||
|
||||
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")
|
||||
s.CheckCall(c, "sudo ros config get rancher.state.dev | grep LABEL=B2D_STATE")
|
||||
s.CheckCall(c, "sudo ros config get rancher.state.autoformat | grep vda")
|
||||
// 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")
|
||||
}
|
||||
28
tests/os_release_test.go
Normal file
28
tests/os_release_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
. "gopkg.in/check.v1"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s *QemuSuite) TestOsRelease(c *C) {
|
||||
s.RunQemu(c)
|
||||
version := ""
|
||||
version = s.CheckOutput(c, version, Not(Equals), "sudo ros -v")
|
||||
version = strings.Replace(version, "ros version ", "", 1)
|
||||
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||
|
||||
s.MakeCall("sudo ros console switch -f alpine")
|
||||
c.Assert(s.WaitForSSH(), IsNil)
|
||||
|
||||
s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
|
||||
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||
|
||||
s.Reboot(c)
|
||||
|
||||
s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
|
||||
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||
}
|
||||
Reference in New Issue
Block a user