summaryrefslogtreecommitdiff
path: root/selftest/target
Commit message (Collapse)AuthorAgeFilesLines
* selftest: s3: add a test for spnego downgrade from krb5 to ntlmIsaac Boukris2019-10-121-0/+9
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14106 Signed-off-by: Isaac Boukris <iboukris@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: add end-to-end tests for mdssvc with a fake HTTP serverRalph Boehme2019-10-091-0/+4
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* selftest/Samba3.pm: use "winbind use krb5 enterprise principals = yes" for ↵Stefan Metzmacher2019-09-241-0/+1
| | | | | | | | | | | | | | ad_member This demonstrates that can do krb5_auth in winbindd without knowning about trusted domains. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Sep 24 19:51:29 UTC 2019 on sn-devel-184
* selftest/Samba3.pm: use "winbind scan trusted domains = no" for ad_memberStefan Metzmacher2019-09-241-0/+1
| | | | | | | | | | This demonstrates that we rely on knowning about trusted domains before we can do krb5_auth in winbindd. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* selftest: Export TRUST information in the ad_member target environmentAndreas Schneider2019-09-242-2/+44
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:selftest: add delay_inject:brl_lock_windows testingStefan Metzmacher2019-09-091-0/+12
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Sep 9 15:42:45 UTC 2019 on sn-devel-184
* CVE-2019-10197: test_smbclient_s3.sh: add regression test for the no ↵Stefan Metzmacher2019-09-031-0/+12
| | | | | | | | permission on share root problem BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* CVE-2019-10197: selftest: make fsrvp_share its own independent subdirectoryStefan Metzmacher2019-09-031-2/+5
| | | | | | | | The next patch will otherwise break the fsrvp related tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14035 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* selftest: Remove obsolete LDAP backend hooks from selftest.pl et alAndrew Bartlett2019-08-302-115/+3
| | | | | | | | This removes some quite complex logic that has not been used since the LDAP backend project was shelved prior to 2011. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
* s4-dns: Deprecate BIND9_FLATFILE and remove "rndc command"Andrew Bartlett2019-08-221-1/+0
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Aug 22 21:24:00 UTC 2019 on sn-devel-184
* torture: beginning of a mdssvc RPC service test-suiteRalph Boehme2019-08-081-0/+9
| | | | | | | Yikes! Most tests fail atm. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: explicitly set "mangled names = yes"Ralph Boehme2019-07-082-0/+2
| | | | | | | | | This is the current default and what 'make test' assumes currently. The next commit will change the default to "illegal". Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: explicitly set "client min protocol = CORE"Stefan Metzmacher2019-07-082-0/+2
| | | | | | | | | This is the current default and what 'make test' assumes currently. The next commit will change the default to disable SMB1. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* selftest: explicitly set "server min protocol = LANMAN1"Stefan Metzmacher2019-07-082-0/+3
| | | | | | | | | This is the current default and what 'make test' assumes currently. The next commit will change the default to disable SMB1. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dns_hub: print usage with too few argsDouglas Bagnall2019-07-051-0/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool domain join: remove the subdomain optionGary Lockyer2019-07-021-103/+0
| | | | | | | Remove the sub domain option from join, as it currently does not work. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: add a test that itime is not set when setting DOS attrsRalph Boehme2019-07-011-0/+5
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jul 1 23:21:07 UTC 2019 on sn-devel-184
* vfs_fruit: make "fruit:zero_file_id" a per share optionRalph Boehme2019-07-011-0/+7
| | | | | | | | Now that File-ID calculation goes through the VFS, we can nicely make a per-share option out of it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: specifying 2008_R2 base schema for tests that need itAaron Haslett2019-06-261-9/+18
| | | | | | | | | | We're going to change the default base schema so this patch changes all tests and testenvs requiring the current default (2008_R2) to specify it in all provision commands using --base-schema. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: allow guest login in the ad_member_idmap_rid envRalph Boehme2019-06-051-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13944 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Don't use global dirs when parsing customdc realmTim Beale2019-05-311-2/+7
| | | | | | | | | | | | | | | | When creating the customdc, testparm would default to using /usr/local/samba sub-directories for creating sockets and lock files. Instead, pass in the tmpdir we just created as an option to the command. Normally this didn't cause a noticeable problem, however, if we run the command with UID-wrapper but without socket-wrapper (i.e. USE_NAMESPACES=1), then it fails completely. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri May 31 06:34:36 UTC 2019 on sn-devel-184
* selftest: Add check customdc has valid realm/domainTim Beale2019-05-311-0/+4
| | | | | | | | | If we couldn't determine the realm/domain from the backup file, it's a lot nicer to fail early with a clear error message (rather than failing later on with a really obscure message). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add linux namespace support (USE_NAMESPACES=1)Tim Beale2019-05-312-3/+109
| | | | | | | | | | | | | | | | | | | | | | This hooks up the selftest/ns/* scripts added earlier with the selftest system, so developers can optionally run a testenv or test using linux namespaces instead of socket-wrapper. The idea is this is experimental functionality that we can extend further in future, in order to make testing Samba more versatile. + The top-level WAF script now does an 'unshare' to create a new top-level 'selftest' namespace in which to create the testenv(s). + selftest.pl creates a common 'selftest0' bridge to connect together the individual DCs. + Update Samba.pm so it can use real IPs instead of loopback addresses. In fork_and_exec(), we add a couple of hooks so that the binary gets started in a different namespace (using unshare/start_in_ns.sh), and the parent process connects the new child namespace up to the common selftest0 bridge (using add_bridge_iface.sh). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add TESTENV_DIR "env" variableTim Beale2019-05-312-1/+3
| | | | | | | | | | | | We store the testenv directory path for the 'ctx' hashmap, but not for the testenv-vars hashmap (and that can be really annoying sometimes). Add it into the second hashmap that selftest actually keeps track of. Currently it's only stored in the hashmap, not actually exported as an environment variable (but we could easily do that if a test-case need this info). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Use scalar variable for new daemon_ctx hashmapTim Beale2019-05-242-18/+18
| | | | | | | | | | | | | | The selftest code typically stores hashmaps as scalar variables (i.e. it only ever uses references to hashmaps). So much so that using a regular hashmap (and passing it by reference via \%daemon_ctx) looks out of place. Using the hashmap directly made more sense when it was only being used locally, but now the hashmap is being passed by reference into a function anyway, so storing it as a scalar doesn't make much difference. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add common fork_and_exec() functionTim Beale2019-05-243-133/+79
| | | | | | | | | | | | Now the code has been refactored, we can move it into a common function. This reduces code duplication and means we have a common place where we start samba daemons from. Note that some daemons behave slightly different, but the $daemon_ctx allows us to customize their behaviour a bit. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Rework setting env variables for other forked binariesTim Beale2019-05-242-12/+16
| | | | | | | | | | | | | | | Final refactor to merge the fork-and-exec code into a common function. We can now use $daemon_ctx{ENV_VARS} to customize differences between the forked binaries: - samba: add in extra env variables on top of the defaults. - dns_hub: there are no ENV variables we need to export. - winbindd/smbd: these use the defaults, so they pass through an undefined $daemon_ctx{ENV_VARS} (purely to make the code common across all 5 places). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Rework setting env variables for nmbdTim Beale2019-05-242-11/+14
| | | | | | | | | Instead of having a special $skip_resolv_conf parameter just for nmbd, use the get_env_for_process() API and customize the hashmap returned. Pass the customized hashmap in as an optional part of the daemon_ctx. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Store fork-and-exec daemon info in a hashmapTim Beale2019-05-242-37/+79
| | | | | | | | | | | | | | This intermediary refactor adds a hashmap that stores the values needed to run each samba daemon. This adds a bit more code in the short term, but it basically means the code in 5 different places now becomes identical, and we can extract it out to a common function. The converting FULL_CMD from an array reference back to an array is a bit ugly, but we can clean this up a bit once the code is all in one place. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add helper function to build up s3 daemon cmdTim Beale2019-05-241-42/+33
| | | | | | | | | | | | | | The s3 daemons all basically use the same command logic, it's just they use slightly different environment variables. This adds a common helper function, which we can pass the specific environment variables into. (Note the slight parameter difference for winbind with --stdout vs --log-stdout). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Move fork cmd args up a levelTim Beale2019-05-242-73/+91
| | | | | | | | | | | | | This is a fairly simple move of code and is the first step in a larger refactor. It doesn't matter if we build up the command args prior to the fork (we only use them in the forked child). But moving the code means the code to handle the fork-and-exec becomes common code that is repeated in several places throughout Samba3.pm and Samba4.pm. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: remove unused variable (@optargs)Tim Beale2019-05-241-2/+1
| | | | | Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Refactor duplicated code to set ENV varsTim Beale2019-05-243-73/+51
| | | | | | | | | | | | | | | Whenever we started a process, we basically used the same code to setup the ENV variables. The s4 ENVNAME may now be slightly different in the child process that runs samba (i.e. '$testenv.samba'), but that ENV var did not appeared to be used much. I'm not sure if the current difference in $skip_resolv_wrapper logic for nmbd was deliberate or accidental, but I've preserved the logic for now. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/target/Samba4.pm: increase max_wait from 60s to 120s to avoid ↵Joe Guo2019-05-101-1/+1
| | | | | | | timeout failure in samba-ad-dc-backup Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add idmap configuration for trusted domain for idmap_adChristof Schmitt2019-04-241-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Make trusted domain information available for idmap_ad environmentChristof Schmitt2019-04-241-0/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Use fl2008r2dc for ad_member_idmap_adChristof Schmitt2019-04-241-1/+1
| | | | | | | | | | fl2008r2dc already has a trusted domain. That will be used to use idmap_ad for querying idmap attributes from the trusted domain. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: rename schemaupgrade_dc (+pair) to schema_dcGarming Sam2019-04-122-8/+8
| | | | | | | | | | | | | | | | This is needed because the name of the autobuild job and the name of the selftest env end up in the socket path for ncalrpc sockets. The challenge is that (for example) /memdisk/autobuild/fl/b2424063/samba-schemaupgrade/bin/ab/schemaupgrade_pair_dc/ncalrpc/np/protected_storage does not fit in a struct sockaddr_un. Signed-off-by: Garming Sam <garming@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Apr 12 05:41:36 UTC 2019 on sn-devel-144
* selftest: Add new 2-DC testenv for live schema upgradeTim Beale2019-04-114-0/+128
| | | | | | | | | | | | | | | | This adds a new 2-DC testenv that: 1. Provisions an AD DC with 2008R2 schema 2. Joins another AD DC with 2008R2 schema 3. Starts Samba 4. Performs a live schema upgrade on the PDC Testenv targetting in tests.py files for this testenv required that we extend the environment dependencies system to include optional post-startup dependencies specified in ENV_DEPS_POST maps. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* selftest: use test smb.conf in provisionDouglas Bagnall2019-03-301-1/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
* selftest: Restore IPs 12-16 for selftest clientTim Beale2019-03-271-8/+25
| | | | | | | | | | | | | | | The assumption that tests only used the .11 IP was wrong. The winsreplication test tries to use multiple different IPs - CI doesn't fail when we remove the additional IPs, but it starts to skip test cases. + Update get_interfaces_config() and get_ipv4_addr() so we can add multiple different IPs for the same host. + Update selftest.pl so the client gets 6 IP addresses. + Update comments to better reflect this dependency. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Do not include system krb5.conf in s4 test environmentsSamuel Cabrero2019-03-221-0/+1
| | | | | | | | | | If built with system MIT krb5 and dns_lookup_kdc is set to false in system krb5.conf tests fail because KDC is not found. Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Samuel Cabrero <scabrero@suse.de> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* selftest: test vfs_nfs4acl_xattr in nfs modeRalph Boehme2019-03-181-0/+18
| | | | | | | | The same tests as for the other modes xdr and ndr are marked as knownfail. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Remove unnecessary dns_hub hashmap entriesTim Beale2019-03-141-4/+1
| | | | | | | | These are only used within the function, and there's already a local variable that stores the same info. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Use consistent env variables for dns_hubTim Beale2019-03-141-6/+6
| | | | | | | | | | | | | | | | Setting up a testenv involves populating 2 different hashmaps - an intermediary one (usually called 'ctx') and one that is used to populate the testenv environment variables (usually called 'env_vars' or 'dcvars'). Because the dns_hub setup is very simple, it doesn't need two different hashmaps. However, the variable names are still a mix of the two hashmaps. This patch updates dns_hub to use the second, more finalized hashmap variable-names. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add helper function to get interfaces configTim Beale2019-03-143-3/+18
| | | | | | | | | | | | Add a helper function to return the IPv4/IPv6 addresses for the smb.conf. This keeps the netmask assumptions in the same places as the IP subnet assumptions. This refactor means we no longer need to store $ctx->{interfaces}, as it was only used in one place. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Remove secondary client interfacesTim Beale2019-03-141-1/+4
| | | | | | | | | | | | | I can't see anything in the tests that ever tries to use these other IP addresses. While it makes sense that we might want the tests to simulate multiple different clients (with different IPs), we don't appear to do this currently. Removing the spare client addresses minimizes the number of hard-coded IP addresses in selftest. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add helper function to create exports file for a testenvTim Beale2019-03-121-0/+10
| | | | | | | | | | | | This writes out the environment variables that are normally setup in the testenv xterm to a file. This allows them to be sourced later. This function is currently unused. However, it provides an alternative replacement for the selftest-vars.sh script (which is really out of date). I do plan to make use of this function in a subsequent patch-set. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Move @exported_envvars into Samba.pmTim Beale2019-03-121-0/+107
| | | | | | | | This brings it closer to the code that actually sets these variables (i.e. Samba3/4.pm). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dns_hub: Add some debug as to what DNS proxying is happeningTim Beale2019-03-061-0/+4
| | | | | | | | | | | | This should make it clear at run-time how dns_hub is actually proxying DNS requests, which will hopefully aid in debugging problems (i.e. forgetting to add a mapping when adding a new DNS realm). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Mar 6 00:48:43 UTC 2019 on sn-devel-144