mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-08-31 16:39:20 +00:00
Fix getting lvm recovery (#70)
This commit is contained in:
@@ -115,9 +115,6 @@ stages:
|
||||
runner = v1mock.NewFakeRunner()
|
||||
|
||||
runner.SideEffect = func(cmd string, args ...string) ([]byte, error) {
|
||||
if cmd == "lsblk" && args[0] == "--list" {
|
||||
return lsblkMockOutput(), nil
|
||||
}
|
||||
if cmd == cmdFail {
|
||||
return []byte{}, errors.New("command error")
|
||||
}
|
||||
@@ -253,8 +250,7 @@ stages:
|
||||
`, device)), constants.FilePerm)
|
||||
Expect(err).To(BeNil())
|
||||
cloudRunner := NewYipCloudInitRunner(logger, runner, afs)
|
||||
res := cloudRunner.Run("test", "/some/yip")
|
||||
Expect(res).NotTo(BeNil())
|
||||
Expect(cloudRunner.Run("test", "/some/yip")).NotTo(BeNil())
|
||||
})
|
||||
It("Fails to find device by path", func() {
|
||||
err := afs.WriteFile("/some/yip/layout.yaml", []byte(`
|
||||
@@ -284,28 +280,3 @@ stages:
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
func lsblkMockOutput() []byte {
|
||||
return []byte(`{ "blockdevices":
|
||||
[
|
||||
{
|
||||
"name": "device",
|
||||
"pkname": "",
|
||||
"path": "/dev/device",
|
||||
"fstype": "",
|
||||
"mountpoint": "",
|
||||
"size": 0,
|
||||
"ro": false,
|
||||
"label": ""
|
||||
},{
|
||||
"name": "device1",
|
||||
"pkname": "device",
|
||||
"path": "/dev/device1",
|
||||
"fstype": "ext4",
|
||||
"mountpoint": "/mnt/fake1",
|
||||
"size": 0,
|
||||
"ro": false,
|
||||
"label": "DEV_LABEL"
|
||||
}
|
||||
]}`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user