Skip to content

Commit

Permalink
stages(kickstart): add unittest test for zerombr/clearpart
Browse files Browse the repository at this point in the history
Trivial followup for PR#1426 to include unit test output about
the expected kickstart file.
  • Loading branch information
mvo5 committed Nov 7, 2023
1 parent 78238ba commit 6ee1da5
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion stages/test/test_kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,42 @@
"keyboard": "us",
"timezone": "UTC",
},
"lang en_US.UTF-8\nkeyboard us\ntimezone UTC"),
"lang en_US.UTF-8\nkeyboard us\ntimezone UTC",
),
({"zerombr": "true"}, "zerombr"),
({"clearpart": {}}, "clearpart"),
({"clearpart": {"all": True}}, "clearpart --all"),
({"clearpart": {"drives": ["hda", "hdb"]}}, "clearpart --drives=hda,hdb",),
({"clearpart": {"drives": ["hda"]}}, "clearpart --drives=hda"),
({"clearpart": {"list": ["sda2", "sda3"]}}, "clearpart --list=sda2,sda3"),
({"clearpart": {"list": ["sda2"]}}, "clearpart --list=sda2"),
({"clearpart": {"disklabel": "some-label"}},
"clearpart --disklabel=some-label",
),
({"clearpart": {"linux": True}}, "clearpart --linux"),
({"clearpart": {
"all": True,
"drives": ["hda", "hdb"],
"list": ["sda2", "sda3"],
"disklabel": "some-label",
"linux": True,
},
},
"clearpart --all --drives=hda,hdb --list=sda2,sda3 --disklabel=some-label --linux"),
({"lang": "en_US.UTF-8",
"keyboard": "us",
"timezone": "UTC",
"zerombr": True,
"clearpart": {
"all": True,
"drives": [
"sd*|hd*|vda",
"/dev/vdc"
]
}
},
"lang en_US.UTF-8\nkeyboard us\ntimezone UTC\nzerombr\nclearpart --all --drives=sd*|hd*|vda,/dev/vdc",
),
])
def test_kickstart(tmp_path, test_input, expected):
ks_stage_path = os.path.join(os.path.dirname(__file__), "../org.osbuild.kickstart")
Expand Down

0 comments on commit 6ee1da5

Please sign in to comment.