mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-07 10:06:39 +00:00
Wire DHCP unit tests into xcattest
This commit is contained in:
@@ -93,9 +93,14 @@ sub new_backend {
|
||||
return $selection if $selection->{error};
|
||||
|
||||
my $backend_class = $class->backend_class( $selection->{name} );
|
||||
( my $backend_file = "$backend_class.pm" ) =~ s{::}{/}g;
|
||||
my $loaded = eval {
|
||||
require $backend_file;
|
||||
if ( $selection->{name} eq 'isc' ) {
|
||||
require xCAT::DHCP::Backend::ISC;
|
||||
} elsif ( $selection->{name} eq 'kea' ) {
|
||||
require xCAT::DHCP::Backend::Kea;
|
||||
} else {
|
||||
die "Unknown DHCP backend '$selection->{name}'";
|
||||
}
|
||||
1;
|
||||
};
|
||||
if (!$loaded) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
start:dhcp_backend_unit_tests
|
||||
description:Run the DHCP backend Perl unit tests through xcattest
|
||||
os:Linux
|
||||
label:mn_only,ci_test,dhcp,unit,dhcp_unit
|
||||
cmd:prove -I/opt/xcat/lib/perl -I/opt/xcat/lib/perl/xCAT /opt/xcat/share/xcat/tools/autotest/unit/dhcp_*.t
|
||||
check:rc==0
|
||||
check:output=~All tests successful
|
||||
end
|
||||
@@ -3,3 +3,4 @@ bin/xcatperftest opt/xcat/bin
|
||||
share/man/man1/* opt/xcat/share/man/man1
|
||||
share/doc/man1/* opt/xcat/share/doc/man1
|
||||
autotest opt/xcat/share/xcat/tools
|
||||
unit opt/xcat/share/xcat/tools/autotest
|
||||
|
||||
@@ -59,6 +59,7 @@ cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
|
||||
|
||||
cp -r autotest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
|
||||
cp -r unit $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
|
||||
|
||||
|
||||
%clean
|
||||
|
||||
Reference in New Issue
Block a user