Skip to content

Commit

Permalink
runtest: add --ks-post,--ks-pre and --ks-pkgs options
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Aug 15, 2023
1 parent f1e077b commit 531aec5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
25 changes: 20 additions & 5 deletions bkr-runtest/gen_job_xml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,23 @@ if {$harness in {r re res rest restr restra restrai restrain restraint rst}} {
}

if [info exist Opt(ks-meta)] { append recipe_ks_meta " " {*}$Opt(ks-meta) }
set ksAppend {}
if [info exist Opt(ks-pkgs)] {
append ksAppend "\n%packages --ignoremissing"
foreach ks $Opt(ks-pkgs) { append ksAppend "\n[string map {" " "\n"} $ks]" }
append ksAppend "\n%end"
}
if [info exist Opt(ks-append)] { foreach ks $Opt(ks-append) { append ksAppend "\n$ks" } }
if [info exist Opt(ks-post)] {
append ksAppend "\n%post"
foreach ks $Opt(ks-post) { append ksAppend "\n$ks" }
append ksAppend "\n%end"
}
if [info exist Opt(ks-pre)] {
append ksAppend "\n%pre"
foreach ks $Opt(ks-pre) { append ksAppend "\n$ks" }
append ksAppend "\n%end"
}

#https://projects.engineering.redhat.com/browse/BKR-4998
append recipe_ks_meta " disabled_root_access"
Expand Down Expand Up @@ -774,11 +791,9 @@ job retention_tag=$retentionTag $productkv user=$jobOwner $jobCtl {
}
}

if [info exist Opt(ks-append)] {
foreach ks $Opt(ks-append) {
ks_append ! {
puts "<!\[CDATA\[\n$ks\]\]>"
}
if {$ksAppend != ""} {
ks_append ! {
puts "<!\[CDATA\[\n$ksAppend\]\]>"
}
}

Expand Down
5 changes: 4 additions & 1 deletion share/common-options.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ set CommonOptionList {
{part partition} {arg m help {Additional <partitions/> for job, example: --part='fs=xfs name=/mnt/xfs size=10 type=part'}}
method {arg y help {Installation source method (nfs, http, ftp)}}
ks-meta {arg m help {Pass kickstart metadata OPTIONS when generating kickstart}}
ks-append {arg m help {Specify additional kickstart commands to add to the base kickstart file}}
ks-append {arg m help {append additional fragment to the base kickstart file}}
ks {link ks-append hide y}
ks-pkgs {arg m help {append additional packages to %packages section in base kickstart file}}
ks-post {arg m help {append additional commands to %post section in the base kickstart file}}
ks-pre {arg m help {append additional commands to %pre section in the base kickstart file}}
ksf {arg y help {Similar to --ks-append, but pass the content of a specified file}}
{k-opts kernel-options} {arg m help {Pass OPTIONS to kernel during installation}}
{k-opts-post kernel-options-post} {arg m help {Pass OPTIONS to kernel after installation}}
Expand Down

0 comments on commit 531aec5

Please sign in to comment.