Fix getting lvm recovery (#70)

This commit is contained in:
Itxaka
2023-06-23 14:49:38 +02:00
committed by GitHub
parent f051fab7bc
commit 9dd1dbddbe
14 changed files with 312 additions and 621 deletions

View File

@@ -16,10 +16,8 @@ limitations under the License.
package action_test
import (
"fmt"
"testing"
"github.com/kairos-io/kairos/v2/pkg/constants"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
@@ -28,76 +26,3 @@ func TestActionSuite(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Actions test suite")
}
func lsblkMockOutput() []byte {
return []byte(fmt.Sprintf(
`{
"blockdevices": [
{
"name": "mmcblk0",
"pkname": null,
"path": "/dev/mmcblk0",
"fstype": null,
"mountpoint": null,
"size": 64088965120,
"ro": false,
"label": null
},{
"name": "mmcblk0p1",
"pkname": "mmcblk0",
"path": "/dev/mmcblk0p1",
"fstype": "vfat",
"mountpoint": null,
"size": 100663296,
"ro": false,
"label": "COS_GRUB"
},{
"name": "mmcblk0p2",
"pkname": "mmcblk0",
"path": "/dev/mmcblk0p2",
"fstype": "ext4",
"mountpoint": "%s",
"size": 6501171200,
"ro": false,
"label": "COS_STATE"
},{
"name": "mmcblk0p3",
"pkname": "mmcblk0",
"path": "/dev/mmcblk0p3",
"fstype": "LVM2_member",
"mountpoint": null,
"size": 4471128064,
"ro": false,
"label": null
},{
"name": "mmcblk0p4",
"pkname": "mmcblk0",
"path": "/dev/mmcblk0p4",
"fstype": "ext4",
"mountpoint": "/usr/local",
"size": 67108864,
"ro": false,
"label": "COS_PERSISTENT"
},{
"name": "KairosVG-oem",
"pkname": "mmcblk0p3",
"path": "/dev/mapper/KairosVG-oem",
"fstype": "ext4",
"mountpoint": "/oem",
"size": 67108864,
"ro": false,
"label": "COS_OEM"
},{
"name": "KairosVG-recovery",
"pkname": "mmcblk0p3",
"path": "/dev/mapper/KairosVG-recovery",
"fstype": "ext4",
"mountpoint": null,
"mountpoint": "%s",
"size": 4399824896,
"ro": false,
"label": "COS_RECOVERY"
}
]
}`, constants.RunningStateDir, constants.LiveDir))
}