File: distname.t

package info (click to toggle)
libsystem-info-perl 0.063-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,444 kB
  • sloc: perl: 2,469; sh: 25; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
use System::Info;

my @etc = sort glob "t/etc/*/DISTNAME";

local $^O = "linux";

foreach my $dnf (@etc) {
    open my $dnh, "<", $dnf or die "$dnf: $!\n";
    chomp (my $dn = <$dnh>);
    close $dnh;

    (my $etc = $dnf) =~ s{/DISTNAME$}{};
    $ENV{SMOKE_USE_ETC} = $etc;

    my $si = System::Info->new;
    is ($si->_distro, $dn, "Distribution\t$dn");

    # Helper line :)
    $si->{__distro} eq $dn and next;

    #use DP;diag (DDumper ($si->{__X__}));
    #print "echo '$si->{__distro}' >$etc/DISTNAME\n";
    }

done_testing ();