diff --git a/init/init.go b/init/init.go index 3d07baac..15336c0d 100644 --- a/init/init.go +++ b/init/init.go @@ -191,7 +191,7 @@ func setupSharedRoot(c *config.CloudConfig) (*config.CloudConfig, error) { if isInitrd() { for _, i := range []string{"/mnt", "/media", "/var/lib/system-docker"} { - if err := os.Mkdir(i, 0755); err != nil { + if err := os.MkdirAll(i, 0755); err != nil { return c, err } if err := mount.Mount("tmpfs", i, "tmpfs", "rw"); err != nil { diff --git a/tests/nonexistent_state_test.go b/tests/nonexistent_state_test.go new file mode 100644 index 00000000..4a306b4f --- /dev/null +++ b/tests/nonexistent_state_test.go @@ -0,0 +1,10 @@ +package integration + +import . "gopkg.in/check.v1" + +func (s *QemuSuite) TestNonexistentState(c *C) { + err := s.RunQemu("--no-format", "--append", "rancher.state.dev=LABEL=NONEXISTENT") + c.Assert(err, IsNil) + + s.CheckCall(c, "sudo ros config get rancher.state.dev | grep LABEL=NONEXISTENT") +}