2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Files
xcat-core/xCAT-test/bats/fixtures/render-network-post.pl
T
2026-10-13 11:37:35 -03:00

25 lines
868 B
Perl

use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use lib "$FindBin::Bin/../../../perl-xCAT";
use lib "$FindBin::Bin/../../../xCAT-server/lib/perl";
use XCAT::Test::File qw(repo_path);
use File::Path qw(make_path);
my ($version, $dir, $debug) = @ARGV;
$version =~ /\A(?:8|10)\z/ or die 'Unsupported postscript';
make_path("$dir/db");
$ENV{XCATROOT} = repo_path('xCAT-server');
$ENV{XCATCFG} = "SQLite:$dir/db";
$ENV{MASTER_IP} = '192.0.2.10';
require xCAT::Table;
require xCAT::Template;
my $site = xCAT::Table->new('site', -create => 1);
$site->setAttribs({ key => 'xcatdebugmode' }, { value => $debug });
$site->close();
my $error = xCAT::Template->subvars(
repo_path("xCAT-server/share/xcat/install/scripts/post.rhels$version"),
"$dir/post", 'node', undef, undef, 'rh', undef, { xcatmaster => '192.0.2.10' });
die $error if $error;