Skip Menu |
 

This queue is for tickets about the Linux-Sysfs CPAN distribution.

Report information
The Basics
Id: 110321
Status: new
Priority: 0/
Queue: Linux-Sysfs

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



Subject: t/class_device.t fails tests for `get_device`, returns `undef`
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-13673-1450080667-746.0-0-0 [...] rt.cpan.org>
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1153

This block of code from line 85 of class_device.t fails:

---

# get_device
{
    my $classdev = Linux::Sysfs::ClassDevice->open($val_class, $val_class_dev);
    isa_ok( $classdev, 'Linux::Sysfs::ClassDevice' );

    my $dev = $classdev->get_device;
    isa_ok( $dev, 'Linux::Sysfs::Device' ); #TODO: errno

    show_device($dev);
    $classdev->close;
}
---

 

It appears to be being called with $val_class = "net" and "$val_class_dev" = "lo"

But $classdev->get_device returns "undef";

I'm guessing this is because there is no device listed at "/sys/class/net/lo/device" while I imagine it may have at some point existed.

 

However, for me "/sys/class/net/eth0/device" exists, and locally forcing "$val_class" to be "eth0" is enough to make this test pass.

 

MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-13673-1450080667-746.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-13673-1450080667-746.0-0-0 [...] rt.cpan.org>
Content-Type: text/html; charset="utf-8"
Message-ID: <rt-4.0.18-13685-1450081267-105.110321-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 321

I suspect you can get around this simply by changing the config rule in 01-config.t

@140
-     return (find_device_paths($path, sub { -d $_  }))[0]->[1];
+    return (find_device_paths($path, sub { -d $_ && -d "$_/device" }))[0]->[1];



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.