--- t/03_destination.t.orig 2008-07-13 12:57:24.069082279 -0700 +++ t/03_destination.t 2008-07-13 13:01:22.587086420 -0700 @@ -31,25 +31,31 @@ ok ($ppd_file); -my $name = "yatp"; -my $location = "nowhere"; -my $printer_info = "blahblah"; -my $device_uri = 'socket://192.168.1.3:9100'; +# SKIP these unless we're running with admin privs and REALLY want to :) +SKIP: { + skip "Not testing destination add/remove", 4 + unless exists $ENV{NET_CUPS_TEST_ADDDEL_DEST}; -$cups->addDestination($name, $location, $printer_info, $ppd_file, $device_uri); + my $name = "yatp"; + my $location = "nowhere"; + my $printer_info = "blahblah"; + my $device_uri = 'socket://192.168.1.3:9100'; -my $dest = $cups->getDestination( $name ); + $cups->addDestination($name, $location, $printer_info, $ppd_file, $device_uri); -ok ($dest); + my $dest = $cups->getDestination( $name ); -my $description = $dest->getDescription(); + ok ($dest); -ok( $description eq $printer_info ); + my $description = $dest->getDescription(); -my $uri = $dest->getUri(); + ok( $description eq $printer_info ); -ok( $uri eq $device_uri ); + my $uri = $dest->getUri(); -$cups->deleteDestination($name); + ok( $uri eq $device_uri ); -ok (! $cups->getDestination($name)); + $cups->deleteDestination($name); + + ok (! $cups->getDestination($name)); +}