s3-printing: Fix vlp testprinter application.
[metze/samba/wip.git] / selftest / target / Samba3.pm
index 2b96226355acc9e7dca9400758f0f06e182db212..bf27f36a50a2ac53b913d5da6eaff327da47bd35 100644 (file)
@@ -117,6 +117,7 @@ sub setup_dc($$)
        my $dc_options = "
        domain master = yes
        domain logons = yes
+       lanman auth = yes
 ";
 
        my $vars = $self->provision($path,
@@ -126,9 +127,8 @@ sub setup_dc($$)
                                    $dc_options);
 
        $self->check_or_start($vars,
-                             ($ENV{NMBD_MAXTIME} or 2700),
-                             ($ENV{WINBINDD_MAXTIME} or 2700),
-                             ($ENV{SMBD_MAXTIME} or 2700));
+                             ($ENV{SMBD_MAXTIME} or 2700),
+                              "yes", "yes", "yes");
 
        $self->wait_for_start($vars);
 
@@ -145,6 +145,7 @@ sub setup_member($$$)
 
        my $member_options = "
        security = domain
+       server signing = on
 ";
        my $ret = $self->provision($prefix,
                                   "LOCALMEMBER3",
@@ -163,9 +164,8 @@ sub setup_member($$$)
        system($cmd) == 0 or die("Join failed\n$cmd");
 
        $self->check_or_start($ret,
-                             ($ENV{NMBD_MAXTIME} or 2700),
-                             ($ENV{WINBINDD_MAXTIME} or 2700),
-                             ($ENV{SMBD_MAXTIME} or 2700));
+                             ($ENV{SMBD_MAXTIME} or 2700),
+                              "yes", "yes", "yes");
 
        $self->wait_for_start($ret);
 
@@ -212,8 +212,8 @@ sub read_pid($$)
        return $pid;
 }
 
-sub check_or_start($$$$) {
-       my ($self, $env_vars, $nmbd_maxtime, $winbindd_maxtime, $smbd_maxtime) = @_;
+sub check_or_start($$$$$) {
+       my ($self, $env_vars, $maxtime, $nmbd, $winbindd, $smbd) = @_;
 
        unlink($env_vars->{NMBD_TEST_LOG});
        print "STARTING NMBD...";
@@ -229,13 +229,13 @@ sub check_or_start($$$$) {
                $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD};
                $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP};
 
-               if ($nmbd_maxtime eq "skip") {
+               if ($nmbd ne "yes") {
                        $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub {
                                my $signame = shift;
                                print("Skip nmbd received signal $signame");
                                exit 0;
                        };
-                       sleep(999999);
+                       sleep($maxtime);
                        exit 0;
                }
 
@@ -246,7 +246,7 @@ sub check_or_start($$$$) {
 
                $ENV{MAKE_TEST_BINARY} = $self->binpath("nmbd");
 
-               my @preargs = ($self->binpath("timelimit"), $nmbd_maxtime);
+               my @preargs = ($self->binpath("timelimit"), $maxtime);
                if(defined($ENV{NMBD_VALGRIND})) { 
                        @preargs = split(/ /, $ENV{NMBD_VALGRIND});
                }
@@ -270,13 +270,13 @@ sub check_or_start($$$$) {
                $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD};
                $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP};
 
-               if ($winbindd_maxtime eq "skip") {
+               if ($winbindd ne "yes") {
                        $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub {
                                my $signame = shift;
                                print("Skip winbindd received signal $signame");
                                exit 0;
                        };
-                       sleep(999999);
+                       sleep($maxtime);
                        exit 0;
                }
 
@@ -287,7 +287,7 @@ sub check_or_start($$$$) {
 
                $ENV{MAKE_TEST_BINARY} = $self->binpath("winbindd");
 
-               my @preargs = ($self->binpath("timelimit"), $winbindd_maxtime);
+               my @preargs = ($self->binpath("timelimit"), $maxtime);
                if(defined($ENV{WINBINDD_VALGRIND})) {
                        @preargs = split(/ /, $ENV{WINBINDD_VALGRIND});
                }
@@ -311,13 +311,13 @@ sub check_or_start($$$$) {
                $ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD};
                $ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP};
 
-               if ($smbd_maxtime eq "skip") {
+               if ($smbd ne "yes") {
                        $SIG{USR1} = $SIG{ALRM} = $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub {
                                my $signame = shift;
                                print("Skip smbd received signal $signame");
                                exit 0;
                        };
-                       sleep(999999);
+                       sleep($maxtime);
                        exit 0;
                }
 
@@ -326,7 +326,7 @@ sub check_or_start($$$$) {
                if (defined($ENV{SMBD_OPTIONS})) {
                        @optargs = split(/ /, $ENV{SMBD_OPTIONS});
                }
-               my @preargs = ($self->binpath("timelimit"), $smbd_maxtime);
+               my @preargs = ($self->binpath("timelimit"), $maxtime);
                if(defined($ENV{SMBD_VALGRIND})) {
                        @preargs = split(/ /,$ENV{SMBD_VALGRIND});
                }
@@ -506,7 +506,15 @@ sub provision($$$$$$)
 [print1]
        copy = tmp
        printable = yes
-       printing = test
+       printing = vlp
+       print command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb print %p %s
+       lpq command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpq %p
+       lp rm command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lprm %p %j
+       lp pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lppause %p %j
+       lp resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpresume %p %j
+       queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p
+       queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
+
 [print2]
        copy = print1
 [print3]
@@ -522,6 +530,7 @@ sub provision($$$$$$)
 
        open(PASSWD, ">$nss_wrapper_passwd") or die("Unable to open $nss_wrapper_passwd");
        print PASSWD "nobody:x:65534:65533:nobody gecos:$prefix_abs:/bin/false
+root:x:65533:65532:root gecos:$prefix_abs:/bin/false
 $unix_name:x:$unix_uid:$unix_gids[0]:$unix_name gecos:$prefix_abs:/bin/false
 ";
        close(PASSWD);