mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-05 04:27:55 +00:00
test(dhcp): use shared version helpers in intent harness
This commit is contained in:
@@ -5,6 +5,7 @@ no warnings 'once';
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../../perl-xCAT";
|
||||
use lib "$FindBin::Bin/../../xCAT-server/lib/perl";
|
||||
|
||||
use File::Temp qw(tempdir);
|
||||
use Socket ();
|
||||
@@ -24,11 +25,6 @@ BEGIN {
|
||||
sub get_site_attribute { return; }
|
||||
$INC{'xCAT/TableUtils.pm'} = __FILE__;
|
||||
|
||||
package xCAT::Utils;
|
||||
sub osver { return 'rhels9'; }
|
||||
sub runcmd { return; }
|
||||
$INC{'xCAT/Utils.pm'} = __FILE__;
|
||||
|
||||
package xCAT::NetworkUtils;
|
||||
sub import {
|
||||
my $caller = caller;
|
||||
@@ -78,6 +74,13 @@ BEGIN {
|
||||
$INC{'xCAT/NodeRange.pm'} = __FILE__;
|
||||
}
|
||||
|
||||
require xCAT::Utils;
|
||||
{
|
||||
no warnings 'redefine';
|
||||
*xCAT::Utils::osver = sub { return 'rhels9'; };
|
||||
*xCAT::Utils::runcmd = sub { return; };
|
||||
}
|
||||
|
||||
my $source_dhcp_plugin = "$FindBin::Bin/../../xCAT-server/lib/xcat/plugins/dhcp.pm";
|
||||
if ( -f $source_dhcp_plugin ) {
|
||||
require $source_dhcp_plugin;
|
||||
|
||||
Reference in New Issue
Block a user