2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-19 02:00:44 +00:00

test(server): check Digest::SHA dependencies

This commit is contained in:
Vinícius Ferrão
2026-08-11 20:11:01 -03:00
parent 2ba1048f24
commit c0de6337da
@@ -0,0 +1,40 @@
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use FindBin;
use Test::More;
my $repo_root = File::Spec->rel2abs(
File::Spec->catdir( $FindBin::Bin, '..', '..' )
);
sub read_file {
my ($filename) = @_;
open( my $fh, '<', $filename )
or die "Unable to read $filename: $!";
my $content = do { local $/; <$fh> };
close($fh);
return $content;
}
my $rpm_spec = read_file(
File::Spec->catfile( $repo_root, 'xCAT-server', 'xCAT-server.spec' )
);
like(
$rpm_spec,
qr/^Requires:.*\bperl\(Digest::SHA\)(?:\s|$)/m,
'the RPM package requires Digest::SHA',
);
my $debian_control = read_file(
File::Spec->catfile( $repo_root, 'xCAT-server', 'debian', 'control' )
);
like(
$debian_control,
qr/^Depends:.*\blibdigest-sha-perl\b/m,
'the Debian package requires Digest::SHA',
);
done_testing();