Skip to content

Commit

Permalink
Add tests for #check_created_partition_table
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Sep 11, 2015
1 parent 993b2d3 commit 6b60153
Show file tree
Hide file tree
Showing 18 changed files with 3,805 additions and 0 deletions.
102 changes: 102 additions & 0 deletions test/fixtures/dmraid-ext4-boot-root.ycp
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
$[
"/dev/btrfs" : $[
"device" : "/dev/btrfs",
"name" : "btrfs",
"partitions" : [
],
"type" : `CT_BTRFS,
"used_by_device" : "",
"used_by_type" : `UB_NONE
],
"/dev/vda" : $[
"bios_id" : "0x80",
"bus" : "None",
"cyl_count" : 1827,
"cyl_size" : 8225280,
"device" : "/dev/vda",
"driver" : "virtio-pci",
"driver_module" : "virtio_pci",
"label" : "msdos",
"max_logical" : 15,
"max_primary" : 4,
"name" : "vda",
"orig_label" : "gpt",
"partitions" : [
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda1",
"format" : true,
"fs_options" : $[
"opt_dir_index" : $[
"option_cmd" : `mkfs,
"option_str" : "-O dir_index",
"option_value" : true
],
"opt_reg_checks" : $[
"option_cmd" : `tunefs,
"option_str" : "-c 0 -i 0",
"option_value" : true
],
"opt_reserved_blocks" : $[
"option_cmd" : `mkfs,
"option_str" : "-m",
"option_value" : "5.0"
]
],
"fsid" : 131,
"fstopt" : "acl,user_xattr",
"fstype" : "Linux native",
"inactive" : true,
"mkfs_opt" : "-O dir_index -m5.0",
"mount" : "/",
"mountby" : `uuid,
"name" : "vda1",
"nr" : 1,
"region" : [
0,
1762
],
"size_k" : 14153265,
"tunefs_opt" : "-c 0 -i 0",
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `ext4,
"userdata" : $[
"/" : "snapshots"
]
],
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda2",
"format" : true,
"fsid" : 130,
"fstype" : "Linux swap",
"inactive" : true,
"mount" : "swap",
"mountby" : `uuid,
"name" : "vda2",
"nr" : 2,
"region" : [
1762,
65
],
"size_k" : 522112,
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `swap
]
],
"proposal_name" : "1. Disk, 14.00 GiB, /dev/vda, ",
"sector_size" : 512,
"size_k" : 14680064,
"transport" : `unknown,
"type" : `CT_DMRAID,
"unique" : "KSbE.Fxp0d3BezAE",
"used_by_device" : "",
"used_by_type" : `UB_NONE
]
]
143 changes: 143 additions & 0 deletions test/fixtures/dmraid-ext4-boot.ycp
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
$[
"/dev/btrfs" : $[
"device" : "/dev/btrfs",
"name" : "btrfs",
"partitions" : [
],
"type" : `CT_BTRFS,
"used_by_device" : "",
"used_by_type" : `UB_NONE
],
"/dev/vda" : $[
"bios_id" : "0x80",
"bus" : "None",
"cyl_count" : 1827,
"cyl_size" : 8225280,
"device" : "/dev/vda",
"driver" : "virtio-pci",
"driver_module" : "virtio_pci",
"label" : "msdos",
"max_logical" : 0,
"max_primary" : 15,
"name" : "vda",
"partitions" : [
$[
"create" : true,
"detected_fs" : `btrfs,
"device" : "/dev/vda1",
"format" : true,
"fs_options" : $[
"opt_dir_index" : $[
"option_cmd" : `mkfs,
"option_str" : "-O dir_index",
"option_value" : true
],
"opt_reg_checks" : $[
"option_cmd" : `tunefs,
"option_str" : "-c 0 -i 0",
"option_value" : true
],
"opt_reserved_blocks" : $[
"option_cmd" : `mkfs,
"option_str" : "-m",
"option_value" : "5.0"
]
],
"fsid" : 131,
"fstopt" : "acl,user_xattr",
"fstype" : "Linux native",
"inactive" : true,
"mkfs_opt" : "-O dir_index -m5.0",
"mount" : "/boot",
"mountby" : `uuid,
"name" : "vda1",
"nr" : 1,
"region" : [
0,
33
],
"size_k" : 265072,
"tunefs_opt" : "-c 0 -i 0",
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `ext4
],
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda2",
"format" : true,
"fs_options" : $[
"opt_dir_index" : $[
"option_cmd" : `mkfs,
"option_str" : "-O dir_index",
"option_value" : true
],
"opt_reg_checks" : $[
"option_cmd" : `tunefs,
"option_str" : "-c 0 -i 0",
"option_value" : true
],
"opt_reserved_blocks" : $[
"option_cmd" : `mkfs,
"option_str" : "-m",
"option_value" : "5.0"
]
],
"fsid" : 131,
"fstopt" : "acl,user_xattr",
"fstype" : "Linux native",
"inactive" : true,
"mkfs_opt" : "-O dir_index -m5.0",
"mount" : "/",
"mountby" : `uuid,
"name" : "vda2",
"nr" : 2,
"region" : [
33,
1762
],
"size_k" : 14153265,
"tunefs_opt" : "-c 0 -i 0",
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `ext4,
"userdata" : $[
"/" : "snapshots"
]
],
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda3",
"format" : true,
"fsid" : 130,
"fstype" : "Linux swap",
"inactive" : true,
"mount" : "swap",
"mountby" : `uuid,
"name" : "vda3",
"nr" : 3,
"region" : [
1795,
32
],
"size_k" : 257040,
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `swap
]
],
"proposal_name" : "1. Disk, 14.00 GiB, /dev/vda, ",
"sector_size" : 512,
"size_k" : 14680064,
"transport" : `unknown,
"type" : `CT_DMRAID,
"unique" : "KSbE.Fxp0d3BezAE",
"used_by_device" : "",
"used_by_type" : `UB_NONE
]
]
128 changes: 128 additions & 0 deletions test/fixtures/gpt-boot-fat.ycp
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
$[
"/dev/btrfs" : $[
"device" : "/dev/btrfs",
"name" : "btrfs",
"partitions" : [
],
"type" : `CT_BTRFS,
"used_by_device" : "",
"used_by_type" : `UB_NONE
],
"/dev/vda" : $[
"bios_id" : "0x80",
"bus" : "None",
"cyl_count" : 1827,
"cyl_size" : 8225280,
"device" : "/dev/vda",
"driver" : "virtio-pci",
"driver_module" : "virtio_pci",
"label" : "gpt",
"max_logical" : 15,
"max_primary" : 4,
"name" : "vda",
"orig_label" : "gpt",
"partitions" : [
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda1",
"format" : true,
"fsid" : 12,
"fstopt" : "umask=0002,utf8=true",
"fstype" : "Win95 FAT32 LBA",
"inactive" : true,
"mount" : "/boot",
"mountby" : `uuid,
"name" : "vda1",
"nr" : 1,
"region" : [
0,
33
],
"size_k" : 265072,
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `vfat,
"userdata" : $[
"/" : "snapshots"
]
],
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda2",
"format" : true,
"fs_options" : $[
"opt_dir_index" : $[
"option_cmd" : `mkfs,
"option_str" : "-O dir_index",
"option_value" : true
],
"opt_reg_checks" : $[
"option_cmd" : `tunefs,
"option_str" : "-c 0 -i 0",
"option_value" : true
],
"opt_reserved_blocks" : $[
"option_cmd" : `mkfs,
"option_str" : "-m",
"option_value" : "5.0"
]
],
"fsid" : 131,
"fstopt" : "acl,user_xattr",
"fstype" : "Linux native",
"inactive" : true,
"mkfs_opt" : "-O dir_index -m5.0",
"mount" : "/",
"mountby" : `uuid,
"name" : "vda2",
"nr" : 2,
"region" : [
33,
1762
],
"size_k" : 14153265,
"tunefs_opt" : "-c 0 -i 0",
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `ext4,
"userdata" : $[
"/" : "snapshots"
]
],
$[
"create" : true,
"detected_fs" : `unknown,
"device" : "/dev/vda3",
"format" : true,
"fsid" : 130,
"fstype" : "Linux swap",
"inactive" : true,
"mount" : "swap",
"mountby" : `uuid,
"name" : "vda3",
"nr" : 3,
"region" : [
1795,
32
],
"size_k" : 257040,
"type" : `primary,
"used_by_device" : "",
"used_by_type" : `UB_NONE,
"used_fs" : `swap
]
],
"proposal_name" : "1. Disk, 14.00 GiB, /dev/vda, ",
"sector_size" : 512,
"size_k" : 14680064,
"transport" : `unknown,
"type" : `CT_DISK,
"unique" : "KSbE.Fxp0d3BezAE",
"used_by_device" : "",
"used_by_type" : `UB_NONE
]
]

0 comments on commit 6b60153

Please sign in to comment.