Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from stdweird/more_aii_fixes
Add more unittests to AII and start code refresh
- Loading branch information
Showing
12 changed files
with
295 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Test::Quattor qw(kickstart_commands); | ||
use NCM::Component::ks; | ||
use CAF::FileWriter; | ||
use CAF::Object; | ||
|
||
=pod | ||
=head1 SYNOPSIS | ||
Tests for the C<kscommands> method. | ||
=cut | ||
|
||
$CAF::Object::NoAction = 1; | ||
|
||
my $fh = CAF::FileWriter->new("target/test/ks"); | ||
# This module simply prints to the default filehandle. | ||
select($fh); | ||
|
||
my $ks = NCM::Component::ks->new('ks'); | ||
my $cfg = get_config_for_profile('kickstart_commands'); | ||
|
||
NCM::Component::ks::kscommands($cfg); | ||
|
||
like($fh, qr{^text}m, 'text mode install present'); | ||
like($fh, qr{^reboot}m, 'reboot after install present'); | ||
like($fh, qr{^skipx}m, 'skip x configuration present'); | ||
like($fh, qr{^auth\s--enableshadow\s--enablemd5}m, 'authentication parameters present'); | ||
like($fh, qr{^install\n^url\s--url http://baseos}m, 'installtype present'); | ||
like($fh, qr{^timezone\s--utc Europe/SomeCity}m, 'timezone present'); | ||
like($fh, qr{^rootpw\s--iscrypted veryverysecret}m, 'crypted root password present'); | ||
like($fh, qr{^bootloader\s--location=mbr}m, 'bootloader present'); | ||
like($fh, qr{^lang\sen_US.UTF-8}m, 'lang setting present'); | ||
like($fh, qr{^keyboard\sus}m, 'keyboard present'); | ||
like($fh, qr{^firewall\s--disabled }m, ' present'); | ||
like($fh, qr{^network\s--bootproto=dhcp}m, ' present'); | ||
like($fh, qr{^zerombr yes}m, 'zerombr present'); | ||
like($fh, qr{^services\s--disabled=disable1,DISABLE2\s--enabled=enable1,ENABLE2}m, "--dis/enable services present"); | ||
|
||
like($fh, qr{^%packages\s--ignoremissing\s--resolvedeps\n^package\n^package2\n^EENNDD\n}m, 'installtype present'); | ||
|
||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@{ | ||
Base kickstart data | ||
@} | ||
template kickstart; | ||
|
||
"/system/network/hostname" = 'x'; | ||
"/system/network/domainname" = 'y'; | ||
|
||
prefix "/software/packages"; | ||
|
||
"{kernel*}/{2.6.32-358.1.el6}/arch/x86_64" = ""; | ||
"{kernel-firmware}/{2.6.32-358.1.el6}/arch/noarch" = ""; | ||
"{ncm-spma}/{14.2.1-1}/arch/noarch" = ""; | ||
"{kernel-module-foo}" = nlist(); | ||
|
||
|
||
# pxelinux and kickstart couple if bootproto is not dhcp | ||
prefix "/system/aii/nbp/pxelinux"; | ||
"ksdevice" = "eth0"; | ||
|
||
prefix "/system/aii/osinstall/ks"; | ||
"bootproto" = "dhcp"; | ||
"keyboard" = "us"; | ||
"lang" = "en_US.UTF-8"; | ||
"node_profile" = "https://somewhere/node_profile"; | ||
"rootpw" = "veryverysecret"; | ||
"osinstall_protocol" = "https"; | ||
"ackurl" = "http://ack"; | ||
"auth" = list ("enableshadow", "enablemd5"); | ||
"bootloader_location" = "mbr"; | ||
"clearmbr" = true; | ||
"enable_sshd" = false; | ||
"email_success" = false; | ||
"installtype" = "url --url http://baseos"; | ||
"timezone" = "Europe/SomeCity"; | ||
"packages" = list("package", "package2"); | ||
"packages_args" = list("--ignoremissing","--resolvedeps"); | ||
"end_script" = "EENNDD"; | ||
"part_label" = false; | ||
"volgroup_required" = false; | ||
|
||
|
||
# optional | ||
"enable_service" = list("enable1", "ENABLE2"); | ||
"disable_service" = list("disable1", "DISABLE2"); | ||
"base_packages" = list("ncm-spma", "kernel-module-foo"); | ||
"disabled_repos" = list(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@{ | ||
Profile to ensure that the kickstart commands and packages section are generated | ||
@} | ||
object template kickstart_commands; | ||
|
||
include 'kickstart'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.