5 use System::Introspector::Probe::Packages::Apt;
7 my $probe = System::Introspector::Probe::Packages::Apt->new;
8 my $data = $probe->gather;
10 ok(scalar(keys %$data), 'received packages');
13 not exists $_->{version}
14 } values %{$data->{installed}{packages}}),
19 local $ENV{PATH} = join ':', "$FindBin::Bin/bin", $ENV{PATH};
20 my $source_list = "$FindBin::Bin/data/apt/sources.list";
21 my $source_list_dir = "$FindBin::Bin/data/apt/sources.list.d";
22 my $probe = System::Introspector::Probe::Packages::Apt->new(
24 apt_update_after => 0,
25 apt_sources => $source_list,
26 apt_sources_dir => $source_list_dir,
28 my $data = $probe->gather;
29 is_deeply $data->{upgradable}, {
31 inst => { foo => '(some foo info)' },
32 remv => { baz => '(some baz info)' },
34 }, 'upgradable packages';
35 ok $data->{update}{last}, 'has last update time';
36 ok $data->{update}{run}, 'has apt run state';
37 is_deeply $data->{sources}, {
40 file_name => $source_list,
41 body => join "", map "$_\n",
42 "deb http://main.example.com foo",
43 "deb http://main.example.com bar",
48 file_name => "$source_list_dir/other.list",
49 body => join "", map "$_\n",
50 "deb http://other.example.com foo",
51 "deb http://other.example.com bar",