Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Oct 16, 2024
1 parent df3c61f commit 6c356dc
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions service/test/agama/storage/config_conversions/to_json_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,16 @@
config_json = config_proc.call(subject.convert)
partitions_json = config_json[:partitions]

expect(partitions_json).to eq([
{
size: { default: true }
},
{
size: { default: true }
}
])
expect(partitions_json).to eq(
[
{
size: { default: true }
},
{
size: { default: true }
}
]
)
end

partition_proc = proc { |c| config_proc.call(c)[:partitions].first }
Expand Down Expand Up @@ -725,11 +727,13 @@

it "generates the expected JSON" do
vg_json = vg_proc.call(subject.convert)
expect(vg_json[:physicalVolumes]).to eq([
"pv1",
"pv2",
{ generate: ["disk1"] }
])
expect(vg_json[:physicalVolumes]).to eq(
[
"pv1",
"pv2",
{ generate: ["disk1"] }
]
)
end

context "and #physical_volumes_encryption is configured" do
Expand All @@ -752,18 +756,20 @@

it "generates the expected JSON" do
vg_json = vg_proc.call(subject.convert)
expect(vg_json[:physicalVolumes]).to eq([
"pv1",
"pv2",
{
generate: {
targetDevices: ["disk1"],
encryption: {
luks1: { password: "12345" }
}
}
}
])
expect(vg_json[:physicalVolumes]).to eq(
[
"pv1",
"pv2",
{
generate: {
targetDevices: ["disk1"],
encryption: {
luks1: { password: "12345" }
}
}
}
]
)
end
end
end
Expand All @@ -789,10 +795,12 @@
size: { default: true }
}

expect(config_json[:logicalVolumes]).to eq([
default_lv_json,
default_lv_json
])
expect(config_json[:logicalVolumes]).to eq(
[
default_lv_json,
default_lv_json
]
)
end

lv_proc = proc { |c| vg_proc.call(c)[:logicalVolumes].first }
Expand Down

0 comments on commit 6c356dc

Please sign in to comment.