Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-local
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Jan 2008 23:32:41 +0000 (10:32 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Jan 2008 23:32:41 +0000 (10:32 +1100)
(This used to be commit 11660b0737107138b53c3a08e8de30ee44607eae)

12 files changed:
.gitignore
source4/build/smb_build/makefile.pm
source4/librpc/idl/lsa.idl
source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source4/pidl/lib/Parse/Pidl/Samba4.pm
source4/pidl/tests/samba3-srv.pl [new file with mode: 0644]
source4/scripting/python/config.mk
source4/selftest/README
source4/selftest/selftest.pl
source4/selftest/target/Samba3.pm [moved from source4/selftest/env/Samba3.pm with 100% similarity]
source4/selftest/target/Samba4.pm [moved from source4/selftest/env/Samba4.pm with 100% similarity]
source4/selftest/target/Windows.pm [moved from source4/selftest/env/Windows.pm with 100% similarity]

index ccc12650c16175460110801c09dcd5746a378a34..9ed0334ea13a80cb4219e91843b306887fb46ea6 100644 (file)
@@ -67,6 +67,7 @@ source/lib/util/pidfile.h
 source/lib/util/unix_privs.h
 source/lib/util/util_proto.h
 source/lib/util/wrap_xattr.h
+source/lib/util/asn1_proto.h
 source/libcli/finddcs.h
 source/libcli/libcli_proto.h
 source/libcli/auth/proto.h
@@ -79,7 +80,6 @@ source/libcli/resolve/proto.h
 source/libcli/security/proto.h
 source/libcli/smb2/smb2_proto.h
 source/libcli/smb_composite/proto.h
-source/libcli/util/asn1_proto.h
 source/libcli/util/clilsa.h
 source/libcli/util/proto.h
 source/libcli/wrepl/winsrepl_proto.h
index 0e7771c3f2a337786abcc17d9b19fcdfc641dbbd..ce1e757c61b9c1523b0d1cc0b44484ab985dc503 100644 (file)
@@ -27,6 +27,7 @@ sub new($$$)
        $self->{torture_progs} = [];
        $self->{static_libs} = [];
        $self->{python_dsos} = [];
+       $self->{python_pys} = [];
        $self->{shared_libs} = [];
        $self->{installable_shared_libs} = [];
        $self->{headers} = [];
@@ -345,7 +346,7 @@ sub SharedModule($$)
 
        push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
 
-       if (defined($ctx->{INIT_FUNCTION})) {
+       if (defined($ctx->{INIT_FUNCTION}) and $ctx->{TYPE} ne "PYTHON") {
                my $init_fn = $ctx->{INIT_FUNCTION_TYPE};
                $init_fn =~ s/\(\*\)/init_module/;
                my $proto_fn = $ctx->{INIT_FUNCTION_TYPE};
@@ -539,7 +540,7 @@ sub PythonFiles($$)
                $self->output("$target: $source\n" .
                                          "\tmkdir -p \$(builddir)/bin/python\n" .
                              "\tcp $source \$@\n\n");
-               push (@{$self->{python_dsos}}, $target);
+               push (@{$self->{python_pys}}, $target);
        }
 }
 
@@ -714,6 +715,7 @@ sub write($$)
        $self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n");
        $self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
        $self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n");
+       $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n");
        $self->output("INSTALLABLE_SHARED_LIBS = " . array2oneperline($self->{installable_shared_libs}) . "\n");
        $self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
        $self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
index 705c86e39b3209f234385ee869661f1a58afeb38..8d26ec0aad2719dd6316c6ac1eefb0f750b6afc3 100644 (file)
@@ -138,9 +138,29 @@ import "security.idl";
                uint32 unknown;
        } lsa_AuditLogInfo;
 
+       typedef [v1_enum] enum {
+               LSA_AUDIT_POLICY_NONE=0,
+               LSA_AUDIT_POLICY_SUCCESS=1,
+               LSA_AUDIT_POLICY_FAILURE=2,
+               LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE),
+               LSA_AUDIT_POLICY_CLEAR=4
+       } lsa_PolicyAuditPolicy;
+
+       typedef enum {
+               LSA_AUDIT_CATEGORY_SYSTEM = 0,
+               LSA_AUDIT_CATEGORY_LOGON = 1,
+               LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS = 2,
+               LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS = 3,
+               LSA_AUDIT_CATEGORY_PROCCESS_TRACKING = 4,
+               LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES = 5,
+               LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT = 6,
+               LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS = 7,        /* only in win2k/2k3 */
+               LSA_AUDIT_CATEGORY_ACCOUNT_LOGON = 8                    /* only in win2k/2k3 */
+       } lsa_PolicyAuditEventType;
+
        typedef struct {
                uint32 auditing_mode;
-               [size_is(count)] uint32 *settings;
+               [size_is(count)] lsa_PolicyAuditPolicy *settings;
                uint32 count;
        } lsa_AuditEventsInfo;
 
index 47312bc83d73add15b11946b6ee193b616a0c2b5..ca9e7d15db019f0ef8c3ddb2d27f155fdf39260d 100644 (file)
@@ -6,13 +6,17 @@
 
 package Parse::Pidl::Samba3::ServerNDR;
 
+use Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(DeclLevel);
+
 use strict;
 use Parse::Pidl qw(warning fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(ParseExpr has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
 use Parse::Pidl::Samba4 qw(ElementStars DeclLong);
-use Parse::Pidl::Samba4::NDR::Parser qw(GenerateFunctionOutEnv);
+use Parse::Pidl::Samba4::Header qw(GenerateFunctionOutEnv);
 
 use vars qw($VERSION);
 $VERSION = '0.01';
index 5848543a6036e141b39d377f7448f77bc0601161..d42e01cdb0424cc51d413fcfa496a934ae534d4e 100644 (file)
@@ -12,6 +12,7 @@ require Exporter;
 use Parse::Pidl::Util qw(has_property is_constant);
 use Parse::Pidl::NDR qw(GetNextLevel);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
+use Parse::Pidl qw(fatal);
 use strict;
 
 use vars qw($VERSION);
diff --git a/source4/pidl/tests/samba3-srv.pl b/source4/pidl/tests/samba3-srv.pl
new file mode 100644 (file)
index 0000000..d1e2bc9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+# (C) 2008 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU General Public License
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Util qw(MyDumper has_property);
+use Parse::Pidl::Samba3::ServerNDR qw(DeclLevel);
+
+my $l = { TYPE => "DATA", DATA_TYPE => "uint32" }; 
+my $e = { FILE => "foo", LINE => 0, PROPERTIES => { }, TYPE => "uint32",
+          LEVELS => [ $l ] };
+
+is("uint32_t", DeclLevel($e, 0));
index f00b4779199a0d6b00b7a607329e51b6c1b73ebd..450da0e90a66603ed4bbff7b2e479089bc29b4ee 100644 (file)
@@ -16,7 +16,7 @@ PRIVATE_DEPENDENCIES = LIBNDR LIBLDB SAMDB CREDENTIALS
 SWIG_FILE = misc.i
 
 # Swig extensions
-swig: pythonmods
+swig:: pythonmods
 
 .SUFFIXES: _wrap.c .i
 
@@ -28,13 +28,19 @@ realdistclean::
        @-rm -f bin/python/*
        # FIXME: Remove _wrap.c files
 
-pythonmods: $(PYTHON_DSOS)
+pythonmods:: $(PYTHON_DSOS) $(PYTHON_PYS)
 
 PYDOCTOR_MODULES=bin/python/ldb.py bin/python/auth.py bin/python/credentials.py bin/python/registry.py bin/python/tdb.py bin/python/security.py bin/python/events.py bin/python/net.py
 
 pydoctor:: pythonmods
        LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --make-html --docformat=restructuredtext --add-package scripting/python/samba/ $(addprefix --add-module , $(PYDOCTOR_MODULES))
 
+installpython:: pythonmods
+       @$(SHELL) $(srcdir)/script/installpython.sh \
+               $(INSTALLPERMS) \
+               $(DESTDIR)$(PYTHONDIR) \
+               scripting/python bin/python
+
 clean::
        @echo "Removing python modules"
        @rm -f bin/python/*
index a0afda3d1966744d8aeee48bedcf9334a23750c6..3250f32ec7891073a48e5e5b7f60f5f476fe7aa9 100644 (file)
@@ -1,6 +1,23 @@
+# vim: ft=rst
+
 This directory contains test scripts that are useful for running a
 bunch of tests all at once. 
 
+===============
+Available tests
+===============
+The available tests are obtained from a script, usually 
+selftest/samba{3,4}_tests.sh. This script should for each test output 
+the name of the test, the command to run and the environment that should be 
+provided.
+
+============
+Environments
+============
+Tests often need to run against a server with particular things set up, 
+a "environment". This environment is provided by the test "target": Samba 3, 
+Samba 4 or Windows.
+
 The following environments are currently available:
 
  - none: No server set up, no variables set.
index 96409558b186daf5c5203d1d4514688bcc7e4a8b..004332a1fc0b131fd3fdc9bc8c6430e85274f399 100755 (executable)
@@ -67,7 +67,7 @@ these tests will be counted as successes, successes will be counted as failures.
 
 The format for the file is, one entry per line:
 
-TESTSUITE-NAME/TEST-NAME
+TESTSUITE-NAME.TEST-NAME
 
 The reason for a test can also be specified, by adding a hash sign (#) and the reason 
 after the test name.
@@ -130,9 +130,6 @@ use POSIX;
 use Cwd qw(abs_path);
 use lib "$RealBin";
 use Subunit qw(parse_results);
-use env::Samba3;
-use env::Samba4;
-use env::Windows;
 use SocketWrapper;
 
 my $opt_help = 0;
@@ -429,17 +426,20 @@ my $testenv_default = "none";
 
 if ($opt_target eq "samba4") {
        $testenv_default = "member";
+       require target::Samba4;
        $target = new Samba4($opt_bindir or "$srcdir/bin", $ldap, "$srcdir/setup");
 } elsif ($opt_target eq "samba3") {
        if ($opt_socket_wrapper and `$opt_bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
                die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'.  Exiting....");
        }
        $testenv_default = "dc";
+       require target::Samba3;
        $target = new Samba3($opt_bindir);
 } elsif ($opt_target eq "win") {
        die("Windows tests will not run with socket wrapper enabled.") 
                if ($opt_socket_wrapper);
        $testenv_default = "dc";
+       require target::Windows;
        $target = new Windows();
 }
 
@@ -741,7 +741,6 @@ sub teardown_env($)
        delete $running_envs{$envname};
 }
 
-
 if ($opt_no_lazy_setup) {
        setup_env($_) foreach (keys %required_envs);
 }