Compare commits

...

25 Commits

Author SHA1 Message Date
Sven Dowideit
569811d1f0 Darn, that was 81 chars
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-25 09:38:45 +00:00
Sven Dowideit
8d3dc7bede Merge pull request #1550 from joshwget/run-udev-before-early-cloud-init
Run udev before early cloud-init
2017-01-25 12:39:57 +10:00
Josh Curl
61191056a7 Run udev before early cloud-init 2017-01-24 11:53:20 -08:00
Sven Dowideit
65c794ea67 Merge pull request #1545 from SvenDowideit/tweak-ascii-art
Add Ros version and TM to banner, and move dmesg console logging into respawn
2017-01-24 21:34:37 +10:00
Sven Dowideit
1b8d869199 Add Ros version and TM to banner, and move dmesg console logging into respawn
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-24 11:33:01 +00:00
Sven Dowideit
27b07dab5a Merge pull request #1535 from SvenDowideit/docker-machine-fix
b2d autoformat test and fix
2017-01-22 22:45:27 +10:00
Sven Dowideit
4e433c272f Merge pull request #1544 from SvenDowideit/linux-4.9.5
upgrade to linux 4.9.5
2017-01-22 21:23:13 +10:00
Sven Dowideit
529c1ec83b upgrade to linux 4.9.5
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-22 21:22:43 +10:00
Sven Dowideit
a4e77692c4 My first pass at fixing the b2d autoformat
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-22 06:43:04 +00:00
Sven Dowideit
1c5d41a56e Add a test for the non-tar b2d autoformat trigger
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-22 06:43:04 +00:00
Sven Dowideit
48acef5336 Merge pull request #1542 from SvenDowideit/underscore_filenames
If golint can't deal with dashes, then argh!
2017-01-22 16:42:25 +10:00
Sven Dowideit
cf1ddf2ff8 If golang can't deal with dashes, then argh!
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-22 06:34:39 +00:00
Sven Dowideit
b79173c272 Merge pull request #1541 from SvenDowideit/run-memory-arg
allow tester to over-ride the vm's memory limit
2017-01-22 16:28:46 +10:00
Sven Dowideit
3a7096f19b allow tester to over-ride the vm's memory limit
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-22 13:14:31 +10:00
Sven Dowideit
353fa604ab Merge pull request #1540 from SvenDowideit/fix-os-release
Add an integration test for os-release
2017-01-21 23:14:13 +10:00
Sven Dowideit
9670aa8505 Add an integration test for os-release
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-21 23:12:41 +10:00
Sven Dowideit
0ec9c2c0e0 Merge pull request #1532 from joshwget/fix-os-release
Fix os-release file
2017-01-21 21:42:39 +10:00
Josh Curl
f906142534 Fix os-release file 2017-01-19 10:57:18 -08:00
Sven Dowideit
a9f19b7d1d Merge pull request #1529 from rancher/revert-1511-use-1.12.6-everywhere
Revert "I've build 1.12.6 for arm&arm64 - should try it out"
2017-01-18 22:15:17 +10:00
Sven Dowideit
1be5c6c527 Revert "I've build 1.12.6 for arm&arm64 - should try it out" 2017-01-18 12:13:33 +00:00
Sven Dowideit
ac761a3973 Merge pull request #1528 from SvenDowideit/more-installer-fixes
More installer fixes
2017-01-18 14:05:17 +10:00
Sven Dowideit
ff32d2d34c avoid kmsg ratelimiting for now
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-18 03:18:43 +00:00
Sven Dowideit
fc1e4e060d Don't prompt for user input when we're not interactive
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-18 02:08:16 +00:00
Sven Dowideit
7765a3308d work around 'No help topic found' issue calling set-disk-partitions script on older RancherOS
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-18 01:44:42 +00:00
Sven Dowideit
8e5eba0ac5 add --debug logging option to installer, and a dummy set-disk-partitions
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-01-18 10:50:37 +10:00
19 changed files with 175 additions and 40 deletions

View File

@@ -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

View File

@@ -34,6 +34,9 @@ shell-bind: .dapper
clean:
@./scripts/clean
itest:
./.dapper integration-test 2>&1 | tee dist/itest.log
help:
@./scripts/help

View File

@@ -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)

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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 {

View File

@@ -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...)
}

View File

@@ -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"]

View File

@@ -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}

View File

@@ -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"]

View File

@@ -4,6 +4,4 @@ FROM rancher/os-installer
RUN rm /dist/ \
&& mkdir -p /dist/
#COPY ./ros /bin/
COPY ./boot/ /dist/

View File

@@ -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

View File

@@ -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

View File

@@ -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} \

View 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
View 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=")
}