diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-25 22:20:52 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:43:36 +0100 |
commit | dc8ece0e26f49618232a78c1d2c4d97454633bde (patch) | |
tree | 680470dd70cc31a09271de646003dece53cb0bdf /source4/selftest | |
parent | 3f073b4c6bfcd7e44fc3dd561874790200bd4d12 (diff) | |
download | samba-dc8ece0e26f49618232a78c1d2c4d97454633bde.tar.gz samba-dc8ece0e26f49618232a78c1d2c4d97454633bde.tar.xz samba-dc8ece0e26f49618232a78c1d2c4d97454633bde.zip |
r25737: Integrate more of the test recipe code into one file, use
different mechanism for determining the quicktest list.
Quicktest is a bit verbose now (reports all the tests not run as SKIP:)
(This used to be commit e99e9c167f49c5f8762c7ad16b10ff4aab98091e)
Diffstat (limited to 'source4/selftest')
-rw-r--r-- | source4/selftest/config.mk | 2 | ||||
-rw-r--r-- | source4/selftest/env/Samba4.pm | 169 | ||||
-rwxr-xr-x | source4/selftest/mk-keyblobs.sh | 156 | ||||
-rwxr-xr-x | source4/selftest/samba4_tests.sh | 288 | ||||
-rwxr-xr-x | source4/selftest/selftest.pl | 59 | ||||
-rwxr-xr-x | source4/selftest/test_echo.sh | 38 | ||||
-rwxr-xr-x | source4/selftest/test_ejs.sh | 18 | ||||
-rwxr-xr-x | source4/selftest/test_functions.sh | 15 | ||||
-rwxr-xr-x | source4/selftest/test_ldap.sh | 31 | ||||
-rwxr-xr-x | source4/selftest/test_nbt.sh | 18 | ||||
-rwxr-xr-x | source4/selftest/test_nss.sh | 11 | ||||
-rwxr-xr-x | source4/selftest/test_rpc.sh | 61 | ||||
-rwxr-xr-x | source4/selftest/test_s3upgrade.sh | 20 | ||||
-rwxr-xr-x | source4/selftest/test_session_key.sh | 30 | ||||
-rwxr-xr-x | source4/selftest/test_swig.sh | 20 | ||||
-rwxr-xr-x | source4/selftest/test_winbind.sh | 28 | ||||
-rwxr-xr-x | source4/selftest/tests_all.sh | 96 | ||||
-rwxr-xr-x | source4/selftest/tests_quick.sh | 47 |
18 files changed, 498 insertions, 609 deletions
diff --git a/source4/selftest/config.mk b/source4/selftest/config.mk index 0f949997dfb..52148090ad0 100644 --- a/source4/selftest/config.mk +++ b/source4/selftest/config.mk @@ -1,7 +1,7 @@ SELFTEST = $(PERL) $(srcdir)/selftest/selftest.pl --prefix=${selftest_prefix} \ --builddir=$(builddir) --srcdir=$(srcdir) \ --expected-failures=$(srcdir)/samba4-knownfail \ - --skip=$(srcdir)/samba4-skip \ + --exclude=$(srcdir)/samba4-skip --testlist="./selftest/samba4_tests.sh|" \ $(TEST_OPTIONS) htmltest: everything diff --git a/source4/selftest/env/Samba4.pm b/source4/selftest/env/Samba4.pm index c5b33bc8975..a43c4dc965a 100644 --- a/source4/selftest/env/Samba4.pm +++ b/source4/selftest/env/Samba4.pm @@ -271,6 +271,172 @@ moduleload syncprov return ($slapd_conf, $pidfile); } +sub mk_keyblobs($$) +{ + my ($self, $tlsdir) = @_; + + #TLS and PKINIT crypto blobs + my $dhfile = "$tlsdir/dhparms.pem"; + my $cafile = "$tlsdir/ca.pem"; + my $certfile = "$tlsdir/cert.pem"; + my $reqkdc = "$tlsdir/req-kdc.der"; + my $kdccertfile = "$tlsdir/kdc.pem"; + my $keyfile = "$tlsdir/key.pem"; + my $adminkeyfile = "$tlsdir/adminkey.pem"; + my $reqadmin = "$tlsdir/req-admin.der"; + my $admincertfile = "$tlsdir/admincert.pem"; + + mkdir($tlsdir, 0777); + + #This is specified here to avoid draining entropy on every run + open(DHFILE, ">$dhfile"); + print DHFILE <<EOF; +-----BEGIN DH PARAMETERS----- +MGYCYQC/eWD2xkb7uELmqLi+ygPMKyVcpHUo2yCluwnbPutEueuxrG/Cys8j8wLO +svCN/jYNyR2NszOmg7ZWcOC/4z/4pWDVPUZr8qrkhj5MRKJc52MncfaDglvEdJrv +YX70obsCAQI= +-----END DH PARAMETERS----- +EOF + close(DHFILE); + + #Likewise, we pregenerate the key material. This allows the + #other certificates to be pre-generated + open(KEYFILE, ">$keyfile"); + print KEYFILE <<EOF; +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpc +ol3+S9/6I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H +6H+pPqVIRLOmrWImai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQAB +AoGAAqDLzFRR/BF1kpsiUfL4WFvTarCe9duhwj7ORc6fs785qAXuwUYAJ0Uvzmy6 +HqoGv3t3RfmeHDmjcpPHsbOKnsOQn2MgmthidQlPBMWtQMff5zdoYNUFiPS0XQBq +szNW4PRjaA9KkLQVTwnzdXGkBSkn/nGxkaVu7OR3vJOBoo0CQQDO4upypesnbe6p +9/xqfZ2uim8IwV1fLlFClV7WlCaER8tsQF4lEi0XSzRdXGUD/dilpY88Nb+xok/X +8Z8OvgAXAkEA+pcLsx1gN7kxnARxv54jdzQjC31uesJgMKQXjJ0h75aUZwTNHmZQ +vPxi6u62YiObrN5oivkixwFNncT9MxTxVQJBAMaWUm2SjlLe10UX4Zdm1MEB6OsC +kVoX37CGKO7YbtBzCfTzJGt5Mwc1DSLA2cYnGJqIfSFShptALlwedot0HikCQAJu +jNKEKnbf+TdGY8Q0SKvTebOW2Aeg80YFkaTvsXCdyXrmdQcifw4WdO9KucJiDhSz +Y9hVapz7ykEJtFtWjLECQQDIlfc63I5ZpXfg4/nN4IJXUW6AmPVOYIA5215itgki +cSlMYli1H9MEXH0pQMGv5Qyd0OYIx2DDg96mZ+aFvqSG +-----END RSA PRIVATE KEY----- +EOF + close(KEYFILE); + + open(ADMINKEYFILE, ">$adminkeyfile"); + + print ADMINKEYFILE <<EOF; +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQD0+OL7TQBj0RejbIH1+g5GeRaWaM9xF43uE5y7jUHEsi5owhZF +5iIoHZeeL6cpDF5y1BZRs0JlA1VqMry1jjKlzFYVEMMFxB6esnXhl0Jpip1JkUMM +XLOP1m/0dqayuHBWozj9f/cdyCJr0wJIX1Z8Pr+EjYRGPn/MF0xdl3JRlwIDAQAB +AoGAP8mjCP628Ebc2eACQzOWjgEvwYCPK4qPmYOf1zJkArzG2t5XAGJ5WGrENRuB +cm3XFh1lpmaADl982UdW3gul4gXUy6w4XjKK4vVfhyHj0kZ/LgaXUK9BAGhroJ2L +osIOUsaC6jdx9EwSRctwdlF3wWJ8NK0g28AkvIk+FlolW4ECQQD7w5ouCDnf58CN +u4nARx4xv5XJXekBvOomkCQAmuOsdOb6b9wn3mm2E3au9fueITjb3soMR31AF6O4 +eAY126rXAkEA+RgHzybzZEP8jCuznMqoN2fq/Vrs6+W3M8/G9mzGEMgLLpaf2Jiz +I9tLZ0+OFk9tkRaoCHPfUOCrVWJZ7Y53QQJBAMhoA6rw0WDyUcyApD5yXg6rusf4 +ASpo/tqDkqUIpoL464Qe1tjFqtBM3gSXuhs9xsz+o0bzATirmJ+WqxrkKTECQHt2 +OLCpKqwAspU7N+w32kaUADoRLisCEdrhWklbwpQgwsIVsCaoEOpt0CLloJRYTANE +yoZeAErTALjyZYZEPcECQQDlUi0N8DFxQ/lOwWyR3Hailft+mPqoPCa8QHlQZnlG ++cfgNl57YHMTZFwgUVFRdJNpjH/WdZ5QxDcIVli0q+Ko +-----END RSA PRIVATE KEY----- +EOF + + #generated with + #hxtool issue-certificate --self-signed --issue-ca --ca-private-key=FILE:$KEYFILE \ + # --subject="CN=CA,$BASEDN" --certificate="FILE:$CAFILE" + + open(CAFILE, ">$cafile"); + print CAFILE <<EOF; +-----BEGIN CERTIFICATE----- +MIIChTCCAe6gAwIBAgIUFZoF6jt0R+hQBdF7cWPy0tT3fGwwCwYJKoZIhvcNAQEFMFIxEzAR +BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy +LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDU1MzA5WhgPMjAwODAxMjQw +NTUzMDlaMFIxEzARBgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxl +MRUwEwYKCZImiZPyLGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpcol3+S9/6 +I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H6H+pPqVIRLOmrWIm +ai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQABo1YwVDAOBgNVHQ8BAf8EBAMC +AqQwEgYDVR0lBAswCQYHKwYBBQIDBTAdBgNVHQ4EFgQUwtm596AMotmzRU7IVdgrUvozyjIw +DwYDVR0TBAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOBgQBgzh5uLDmESGYv60iUdEfuk/T9 +VCpzb1z3VJVWt3uJoQYbcpR00SKeyMdlfTTLzO6tSPMmlk4hwqfvLkPzGCSObR4DRRYa0BtY +2laBVlg9X59bGpMUvpFQfpvxjvFWNJDL+377ELCVpLNdoR23I9TKXlalj0bY5Ks46CVIrm6W +EA== +-----END CERTIFICATE----- +EOF + + #generated with GNUTLS internally in Samba. + + open(CERTFILE, ">$certfile"); + print CERTFILE <<EOF; +-----BEGIN CERTIFICATE----- +MIICYTCCAcygAwIBAgIE5M7SRDALBgkqhkiG9w0BAQUwZTEdMBsGA1UEChMUU2Ft +YmEgQWRtaW5pc3RyYXRpb24xNDAyBgNVBAsTK1NhbWJhIC0gdGVtcG9yYXJ5IGF1 +dG9nZW5lcmF0ZWQgY2VydGlmaWNhdGUxDjAMBgNVBAMTBVNhbWJhMB4XDTA2MDgw +NDA0MzY1MloXDTA4MDcwNDA0MzY1MlowZTEdMBsGA1UEChMUU2FtYmEgQWRtaW5p +c3RyYXRpb24xNDAyBgNVBAsTK1NhbWJhIC0gdGVtcG9yYXJ5IGF1dG9nZW5lcmF0 +ZWQgY2VydGlmaWNhdGUxDjAMBgNVBAMTBVNhbWJhMIGcMAsGCSqGSIb3DQEBAQOB +jAAwgYgCgYDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpcol3+ +S9/6I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H6H+p +PqVIRLOmrWImai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQABoyUw +IzAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsGCSqGSIb3DQEB +BQOBgQAmkN6XxvDnoMkGcWLCTwzxGfNNSVcYr7TtL2aJh285Xw9zaxcm/SAZBFyG +LYOChvh6hPU7joMdDwGfbiLrBnMag+BtGlmPLWwp/Kt1wNmrRhduyTQFhN3PP6fz +nBr9vVny2FewB2gHmelaPS//tXdxivSXKz3NFqqXLDJjq7P8wA== +-----END CERTIFICATE----- +EOF + close(CERTFILE); + + #KDC certificate + # hxtool request-create --subject="CN=krbtgt,cn=users,$basedn" --key=FILE:$KEYFILE $KDCREQ + + # hxtool issue-certificate --ca-certificate=FILE:$CAFILE,$KEYFILE --type="pkinit-kdc" --pk-init-principal="krbtgt/$RELAM@$REALM" --req="$KDCREQ" --certificate="FILE:$KDCCERTFILE" + + open(KDCCERTFILE, ">$kdccertfile"); + print KDCCERTFILE <<EOF; +-----BEGIN CERTIFICATE----- +MIIDDDCCAnWgAwIBAgIUDEhjaOT1ZjHjHHEn+l5eYO05oK8wCwYJKoZIhvcNAQEFMFIxEzAR +BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy +LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDcwNzA4WhgPMjAwODAxMjQw +NzA3MDhaMGYxEzARBgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxl +MRUwEwYKCZImiZPyLGQBGQwFc2FtYmExDjAMBgNVBAMMBXVzZXJzMQ8wDQYDVQQDDAZrcmJ0 +Z3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMqDqkDAIdQwDUN8cOZaFl934XQL70nF +yq+nD2KL0SfcTW5+WlyiXf5L3/oj+5pOYkdmt74MXd1PNv9Q5mjRl6bw34jPOSCgaQVp+Ne5 +PcEvlQ9jb8fof6k+pUhEs6atYiZqLfn1jKgqEXKjftjoc95TxBxn67atL2B5qkhZ966jAgMB +AAGjgcgwgcUwDgYDVR0PAQH/BAQDAgWgMBIGA1UdJQQLMAkGBysGAQUCAwUwVAYDVR0RBE0w +S6BJBgYrBgEFAgKgPzA9oBMbEVNBTUJBLkVYQU1QTEUuQ09NoSYwJKADAgEBoR0wGxsGa3Ji +dGd0GxFTQU1CQS5FWEFNUExFLkNPTTAfBgNVHSMEGDAWgBTC2bn3oAyi2bNFTshV2CtS+jPK +MjAdBgNVHQ4EFgQUwtm596AMotmzRU7IVdgrUvozyjIwCQYDVR0TBAIwADANBgkqhkiG9w0B +AQUFAAOBgQCMSgLkIv9RobE0a95H2ECA+5YABBwKXIt4AyN/HpV7iJdRx7B9PE6vM+nboVKY +E7i7ECUc3bu6NgrLu7CKHelNclHWWMiZzSUwhkXyvG/LE9qtr/onNu9NfLt1OV+dwQwyLdEP +n63FxSmsKg3dfi3ryQI/DIKeisvipwDtLqOn9g== +-----END CERTIFICATE----- +EOF + + #hxtool request-create --subject="CN=Administrator,cn=users,$basedn" --key=FILE:$ADMINKEYFILE $ADMINREQFILE + #hxtool issue-certificate --ca-certificate=FILE:$CAFILE,$KEYFILE --type="pkinit-client" --pk-init-principal="administrator@$REALM" --req="$ADMINREQFILE" --certificate="FILE:$ADMINCERTFILE" + + open(ADMINCERTFILE, ">$admincertfile"); + print ADMINCERTFILE <<EOF; +-----BEGIN CERTIFICATE----- +MIICwjCCAiugAwIBAgIUXyECoq4im33ByZDWZMGhtpvHYWEwCwYJKoZIhvcNAQEFMFIxEzAR +BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy +LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDcyMzE2WhgPMjAwODAxMjQw +NzIzMTZaMCgxDjAMBgNVBAMMBXVzZXJzMRYwFAYDVQQDDA1BZG1pbmlzdHJhdG9yMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQD0+OL7TQBj0RejbIH1+g5GeRaWaM9xF43uE5y7jUHE +si5owhZF5iIoHZeeL6cpDF5y1BZRs0JlA1VqMry1jjKlzFYVEMMFxB6esnXhl0Jpip1JkUMM +XLOP1m/0dqayuHBWozj9f/cdyCJr0wJIX1Z8Pr+EjYRGPn/MF0xdl3JRlwIDAQABo4G8MIG5 +MA4GA1UdDwEB/wQEAwIFoDASBgNVHSUECzAJBgcrBgEFAgMEMEgGA1UdEQRBMD+gPQYGKwYB +BQICoDMwMaATGxFTQU1CQS5FWEFNUExFLkNPTaEaMBigAwIBAaERMA8bDWFkbWluaXN0cmF0 +b3IwHwYDVR0jBBgwFoAUwtm596AMotmzRU7IVdgrUvozyjIwHQYDVR0OBBYEFCDzVsvJ8IDz +wLYH8EONeUa5oVrGMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEFBQADgYEAbTCnaPTieVZPV3bH +UmAMbnF9+YN1mCbe2xZJ0xzve+Yw1XO82iv/9kZaZkcRkaQt2qcwsBK/aSPOgfqGx+mJ7hXQ +AGWvAJhnWi25PawNaRysCN8WC6+nWKR4d2O2m5rpj3T9kH5WE7QbG0bCu92dGaS29FvWDCP3 +q9pRtDOoAZc= +-----END CERTIFICATE----- +EOF + close(ADMINCERTFILE); +} + sub provision($$$$$$) { my ($self, $prefix, $server_role, $netbiosname, $netbiosalias, $swiface, $password) = @_; @@ -368,8 +534,7 @@ sub provision($$$$$$) "; close(CONFFILE); - die ("Unable to create key blobs") if - (system("TLSDIR=$tlsdir $RealBin/mk-keyblobs.sh") != 0); + $self->mk_keyblobs($tlsdir); open(KRB5CONF, ">$krb5_config"); print KRB5CONF " diff --git a/source4/selftest/mk-keyblobs.sh b/source4/selftest/mk-keyblobs.sh deleted file mode 100755 index 7792e0a6d5e..00000000000 --- a/source4/selftest/mk-keyblobs.sh +++ /dev/null @@ -1,156 +0,0 @@ -#TLS and PKINIT crypto blobs -DHFILE=$TLSDIR/dhparms.pem -CAFILE=$TLSDIR/ca.pem -CERTFILE=$TLSDIR/cert.pem -REQKDC=$TLSDIR/req-kdc.der -KDCCERTFILE=$TLSDIR/kdc.pem -KEYFILE=$TLSDIR/key.pem -ADMINKEYFILE=$TLSDIR/adminkey.pem -REQADMIN=$TLSDIR/req-admin.der -ADMINKEYFILE=$TLSDIR/adminkey.pem -ADMINCERTFILE=$TLSDIR/admincert.pem - -mkdir -p $TLSDIR - -#This is specified here to avoid draining entropy on every run -cat >$DHFILE<<EOF ------BEGIN DH PARAMETERS----- -MGYCYQC/eWD2xkb7uELmqLi+ygPMKyVcpHUo2yCluwnbPutEueuxrG/Cys8j8wLO -svCN/jYNyR2NszOmg7ZWcOC/4z/4pWDVPUZr8qrkhj5MRKJc52MncfaDglvEdJrv -YX70obsCAQI= ------END DH PARAMETERS----- - -EOF - -#Likewise, we pregenerate the key material. This allows the -#other certificates to be pre-generated -cat >$KEYFILE<<EOF ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpc -ol3+S9/6I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H -6H+pPqVIRLOmrWImai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQAB -AoGAAqDLzFRR/BF1kpsiUfL4WFvTarCe9duhwj7ORc6fs785qAXuwUYAJ0Uvzmy6 -HqoGv3t3RfmeHDmjcpPHsbOKnsOQn2MgmthidQlPBMWtQMff5zdoYNUFiPS0XQBq -szNW4PRjaA9KkLQVTwnzdXGkBSkn/nGxkaVu7OR3vJOBoo0CQQDO4upypesnbe6p -9/xqfZ2uim8IwV1fLlFClV7WlCaER8tsQF4lEi0XSzRdXGUD/dilpY88Nb+xok/X -8Z8OvgAXAkEA+pcLsx1gN7kxnARxv54jdzQjC31uesJgMKQXjJ0h75aUZwTNHmZQ -vPxi6u62YiObrN5oivkixwFNncT9MxTxVQJBAMaWUm2SjlLe10UX4Zdm1MEB6OsC -kVoX37CGKO7YbtBzCfTzJGt5Mwc1DSLA2cYnGJqIfSFShptALlwedot0HikCQAJu -jNKEKnbf+TdGY8Q0SKvTebOW2Aeg80YFkaTvsXCdyXrmdQcifw4WdO9KucJiDhSz -Y9hVapz7ykEJtFtWjLECQQDIlfc63I5ZpXfg4/nN4IJXUW6AmPVOYIA5215itgki -cSlMYli1H9MEXH0pQMGv5Qyd0OYIx2DDg96mZ+aFvqSG ------END RSA PRIVATE KEY----- - -EOF - -cat >$ADMINKEYFILE<<EOF ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQD0+OL7TQBj0RejbIH1+g5GeRaWaM9xF43uE5y7jUHEsi5owhZF -5iIoHZeeL6cpDF5y1BZRs0JlA1VqMry1jjKlzFYVEMMFxB6esnXhl0Jpip1JkUMM -XLOP1m/0dqayuHBWozj9f/cdyCJr0wJIX1Z8Pr+EjYRGPn/MF0xdl3JRlwIDAQAB -AoGAP8mjCP628Ebc2eACQzOWjgEvwYCPK4qPmYOf1zJkArzG2t5XAGJ5WGrENRuB -cm3XFh1lpmaADl982UdW3gul4gXUy6w4XjKK4vVfhyHj0kZ/LgaXUK9BAGhroJ2L -osIOUsaC6jdx9EwSRctwdlF3wWJ8NK0g28AkvIk+FlolW4ECQQD7w5ouCDnf58CN -u4nARx4xv5XJXekBvOomkCQAmuOsdOb6b9wn3mm2E3au9fueITjb3soMR31AF6O4 -eAY126rXAkEA+RgHzybzZEP8jCuznMqoN2fq/Vrs6+W3M8/G9mzGEMgLLpaf2Jiz -I9tLZ0+OFk9tkRaoCHPfUOCrVWJZ7Y53QQJBAMhoA6rw0WDyUcyApD5yXg6rusf4 -ASpo/tqDkqUIpoL464Qe1tjFqtBM3gSXuhs9xsz+o0bzATirmJ+WqxrkKTECQHt2 -OLCpKqwAspU7N+w32kaUADoRLisCEdrhWklbwpQgwsIVsCaoEOpt0CLloJRYTANE -yoZeAErTALjyZYZEPcECQQDlUi0N8DFxQ/lOwWyR3Hailft+mPqoPCa8QHlQZnlG -+cfgNl57YHMTZFwgUVFRdJNpjH/WdZ5QxDcIVli0q+Ko ------END RSA PRIVATE KEY----- - -EOF - -#generated with -#hxtool issue-certificate --self-signed --issue-ca --ca-private-key=FILE:$KEYFILE \ -# --subject="CN=CA,$BASEDN" --certificate="FILE:$CAFILE" - -cat >$CAFILE<<EOF ------BEGIN CERTIFICATE----- -MIIChTCCAe6gAwIBAgIUFZoF6jt0R+hQBdF7cWPy0tT3fGwwCwYJKoZIhvcNAQEFMFIxEzAR -BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy -LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDU1MzA5WhgPMjAwODAxMjQw -NTUzMDlaMFIxEzARBgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxl -MRUwEwYKCZImiZPyLGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpcol3+S9/6 -I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H6H+pPqVIRLOmrWIm -ai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQABo1YwVDAOBgNVHQ8BAf8EBAMC -AqQwEgYDVR0lBAswCQYHKwYBBQIDBTAdBgNVHQ4EFgQUwtm596AMotmzRU7IVdgrUvozyjIw -DwYDVR0TBAgwBgEB/wIBADANBgkqhkiG9w0BAQUFAAOBgQBgzh5uLDmESGYv60iUdEfuk/T9 -VCpzb1z3VJVWt3uJoQYbcpR00SKeyMdlfTTLzO6tSPMmlk4hwqfvLkPzGCSObR4DRRYa0BtY -2laBVlg9X59bGpMUvpFQfpvxjvFWNJDL+377ELCVpLNdoR23I9TKXlalj0bY5Ks46CVIrm6W -EA== ------END CERTIFICATE----- - -EOF - -#generated with GNUTLS internally in Samba. - -cat >$CERTFILE<<EOF ------BEGIN CERTIFICATE----- -MIICYTCCAcygAwIBAgIE5M7SRDALBgkqhkiG9w0BAQUwZTEdMBsGA1UEChMUU2Ft -YmEgQWRtaW5pc3RyYXRpb24xNDAyBgNVBAsTK1NhbWJhIC0gdGVtcG9yYXJ5IGF1 -dG9nZW5lcmF0ZWQgY2VydGlmaWNhdGUxDjAMBgNVBAMTBVNhbWJhMB4XDTA2MDgw -NDA0MzY1MloXDTA4MDcwNDA0MzY1MlowZTEdMBsGA1UEChMUU2FtYmEgQWRtaW5p -c3RyYXRpb24xNDAyBgNVBAsTK1NhbWJhIC0gdGVtcG9yYXJ5IGF1dG9nZW5lcmF0 -ZWQgY2VydGlmaWNhdGUxDjAMBgNVBAMTBVNhbWJhMIGcMAsGCSqGSIb3DQEBAQOB -jAAwgYgCgYDKg6pAwCHUMA1DfHDmWhZfd+F0C+9Jxcqvpw9ii9En3E1uflpcol3+ -S9/6I/uaTmJHZre+DF3dTzb/UOZo0Zem8N+IzzkgoGkFafjXuT3BL5UPY2/H6H+p -PqVIRLOmrWImai359YyoKhFyo37Y6HPeU8QcZ+u2rS9geapIWfeuowIDAQABoyUw -IzAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsGCSqGSIb3DQEB -BQOBgQAmkN6XxvDnoMkGcWLCTwzxGfNNSVcYr7TtL2aJh285Xw9zaxcm/SAZBFyG -LYOChvh6hPU7joMdDwGfbiLrBnMag+BtGlmPLWwp/Kt1wNmrRhduyTQFhN3PP6fz -nBr9vVny2FewB2gHmelaPS//tXdxivSXKz3NFqqXLDJjq7P8wA== ------END CERTIFICATE----- - -EOF - -#KDC certificate -# hxtool request-create --subject="CN=krbtgt,cn=users,$basedn" --key=FILE:$KEYFILE $KDCREQ - -# hxtool issue-certificate --ca-certificate=FILE:$CAFILE,$KEYFILE --type="pkinit-kdc" --pk-init-principal="krbtgt/$RELAM@$REALM" --req="$KDCREQ" --certificate="FILE:$KDCCERTFILE" - -cat >$KDCCERTFILE<<EOF ------BEGIN CERTIFICATE----- -MIIDDDCCAnWgAwIBAgIUDEhjaOT1ZjHjHHEn+l5eYO05oK8wCwYJKoZIhvcNAQEFMFIxEzAR -BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy -LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDcwNzA4WhgPMjAwODAxMjQw -NzA3MDhaMGYxEzARBgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxl -MRUwEwYKCZImiZPyLGQBGQwFc2FtYmExDjAMBgNVBAMMBXVzZXJzMQ8wDQYDVQQDDAZrcmJ0 -Z3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMqDqkDAIdQwDUN8cOZaFl934XQL70nF -yq+nD2KL0SfcTW5+WlyiXf5L3/oj+5pOYkdmt74MXd1PNv9Q5mjRl6bw34jPOSCgaQVp+Ne5 -PcEvlQ9jb8fof6k+pUhEs6atYiZqLfn1jKgqEXKjftjoc95TxBxn67atL2B5qkhZ966jAgMB -AAGjgcgwgcUwDgYDVR0PAQH/BAQDAgWgMBIGA1UdJQQLMAkGBysGAQUCAwUwVAYDVR0RBE0w -S6BJBgYrBgEFAgKgPzA9oBMbEVNBTUJBLkVYQU1QTEUuQ09NoSYwJKADAgEBoR0wGxsGa3Ji -dGd0GxFTQU1CQS5FWEFNUExFLkNPTTAfBgNVHSMEGDAWgBTC2bn3oAyi2bNFTshV2CtS+jPK -MjAdBgNVHQ4EFgQUwtm596AMotmzRU7IVdgrUvozyjIwCQYDVR0TBAIwADANBgkqhkiG9w0B -AQUFAAOBgQCMSgLkIv9RobE0a95H2ECA+5YABBwKXIt4AyN/HpV7iJdRx7B9PE6vM+nboVKY -E7i7ECUc3bu6NgrLu7CKHelNclHWWMiZzSUwhkXyvG/LE9qtr/onNu9NfLt1OV+dwQwyLdEP -n63FxSmsKg3dfi3ryQI/DIKeisvipwDtLqOn9g== ------END CERTIFICATE----- - -EOF - -#hxtool request-create --subject="CN=Administrator,cn=users,$basedn" --key=FILE:$ADMINKEYFILE $ADMINREQFILE -#hxtool issue-certificate --ca-certificate=FILE:$CAFILE,$KEYFILE --type="pkinit-client" --pk-init-principal="administrator@$REALM" --req="$ADMINREQFILE" --certificate="FILE:$ADMINCERTFILE" - -cat >$ADMINCERTFILE<<EOF ------BEGIN CERTIFICATE----- -MIICwjCCAiugAwIBAgIUXyECoq4im33ByZDWZMGhtpvHYWEwCwYJKoZIhvcNAQEFMFIxEzAR -BgoJkiaJk/IsZAEZDANjb20xFzAVBgoJkiaJk/IsZAEZDAdleGFtcGxlMRUwEwYKCZImiZPy -LGQBGQwFc2FtYmExCzAJBgNVBAMMAkNBMCIYDzIwMDcwMTIzMDcyMzE2WhgPMjAwODAxMjQw -NzIzMTZaMCgxDjAMBgNVBAMMBXVzZXJzMRYwFAYDVQQDDA1BZG1pbmlzdHJhdG9yMIGfMA0G -CSqGSIb3DQEBAQUAA4GNADCBiQKBgQD0+OL7TQBj0RejbIH1+g5GeRaWaM9xF43uE5y7jUHE -si5owhZF5iIoHZeeL6cpDF5y1BZRs0JlA1VqMry1jjKlzFYVEMMFxB6esnXhl0Jpip1JkUMM -XLOP1m/0dqayuHBWozj9f/cdyCJr0wJIX1Z8Pr+EjYRGPn/MF0xdl3JRlwIDAQABo4G8MIG5 -MA4GA1UdDwEB/wQEAwIFoDASBgNVHSUECzAJBgcrBgEFAgMEMEgGA1UdEQRBMD+gPQYGKwYB -BQICoDMwMaATGxFTQU1CQS5FWEFNUExFLkNPTaEaMBigAwIBAaERMA8bDWFkbWluaXN0cmF0 -b3IwHwYDVR0jBBgwFoAUwtm596AMotmzRU7IVdgrUvozyjIwHQYDVR0OBBYEFCDzVsvJ8IDz -wLYH8EONeUa5oVrGMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQEFBQADgYEAbTCnaPTieVZPV3bH -UmAMbnF9+YN1mCbe2xZJ0xzve+Yw1XO82iv/9kZaZkcRkaQt2qcwsBK/aSPOgfqGx+mJ7hXQ -AGWvAJhnWi25PawNaRysCN8WC6+nWKR4d2O2m5rpj3T9kH5WE7QbG0bCu92dGaS29FvWDCP3 -q9pRtDOoAZc= ------END CERTIFICATE----- - -EOF diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh new file mode 100755 index 00000000000..29b76fb89d9 --- /dev/null +++ b/source4/selftest/samba4_tests.sh @@ -0,0 +1,288 @@ +#!/bin/sh +if [ ! -n "$PERL" ] +then + PERL=perl +fi + +incdir=`dirname $0` + +plantest() { + name=$1 + env=$2 + shift 2 + cmdline="$*" + echo "-- TEST --" + echo $name + echo $env + echo $cmdline +} + +$incdir/../bin/smbtorture -V + +samba4srcdir=$incdir/.. +samba4bindir=$samba4srcdir/bin +SCRIPTDIR=$samba4srcdir/../testprogs/ejs + +plantest "base.js" dc "$SCRIPTDIR/base.js" $CONFIGURATION +plantest "samr.js" dc "$SCRIPTDIR/samr.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD +plantest "echo.js" dc "$SCRIPTDIR/echo.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD +#plantest "ejsnet.js" dc "$SCRIPTDIR/ejsnet.js" $CONFIGURATION -U\$USERNAME%\$PASSWORD \$DOMAIN ejstestuser +plantest "ldb.js" none "$SCRIPTDIR/ldb.js" `pwd` $CONFIGURATION +plantest "winreg" dc $samba4srcdir/scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U\$USERNAME%\$PASSWORD + +# Simple tests for LDAP and CLDAP + +for options in "" "--option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD --option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD"; do + plantest "TESTING PROTOCOL ldap with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldap \$SERVER_IP $options +done +# see if we support ldaps +if grep ENABLE_GNUTLS.1 include/config.h > /dev/null; then + for options in "" "-U\$USERNAME%\$PASSWORD"; do + plantest "TESTING PROTOCOL ldaps with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldaps \$SERVER_IP $options + done +fi +for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATEVECTOR +do + plantest "$t" dc $samba4bindir/smbtorture $TORTURE_OPTIONS "-U\$USERNAME%\$PASSWORD" //\$SERVER_IP/_none_ $t +done + +# only do the ldb tests when not in quick mode - they are quite slow, and ldb +# is now pretty well tested by the rest of the quick tests anyway +LDBDIR=$samba4srcdir/lib/ldb +export LDBDIR +plantest "ldb" none $LDBDIR/tests/test-tdb.sh + +plantest "ejs ldap" dc $SCRIPTDIR/ldap.js $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD + +# Tests for RPC + +# add tests to this list as they start passing, so we test +# that they stay passing +ncacn_np_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-SAMSYNC RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-LSA RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" +ncalrpc_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-DRSUAPI RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" +ncacn_ip_tcp_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-DSSYNC RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" +slow_ncacn_np_tests="RPC-SAMLOGON RPC-SAMR RPC-SAMR-USERS RPC-SAMR-PASSWORDS" +slow_ncalrpc_tests="RPC-SAMR RPC-SAMR-PASSWORDS" +slow_ncacn_ip_tcp_tests="RPC-SAMR RPC-SAMR-PASSWORDS RPC-CRACKNAMES" + +all_tests="$ncalrpc_tests $ncacn_np_tests $ncacn_ip_tcp_tests $slow_ncalrpc_tests $slow_ncacn_np_tests $slow_ncacn_ip_tcp_tests RPC-SECRETS RPC-SAMBA3-SHARESEC" + +# Make sure all tests get run +for t in `$samba4bindir/smbtorture --list | grep "^RPC-"` +do + echo $all_tests | grep $t > /dev/null + if [ $? -ne 0 ] + then + auto_rpc_tests="$auto_rpc_tests $t" + fi +done + +for bindoptions in seal,padcheck $VALIDATE bigendian; do + for transport in ncalrpc ncacn_np ncacn_ip_tcp; do + case $transport in + ncalrpc) tests=$ncalrpc_tests ;; + ncacn_np) tests=$ncacn_np_tests ;; + ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;; + esac + for t in $tests; do + plantest "$t on $transport with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" + done + plantest "RPC-SAMBA3-SHARESEC on $transport with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=torture:share=tmp $t "$*" + done +done + +for bindoptions in "" $VALIDATE bigendian; do + for t in $auto_rpc_tests; do + plantest "$t with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" + done +done + +for bindoptions in connect $VALIDATE ; do + for transport in ncalrpc ncacn_np ncacn_ip_tcp; do + case $transport in + ncalrpc) tests=$slow_ncalrpc_tests ;; + ncacn_np) tests=$slow_ncacn_np_tests ;; + ncacn_ip_tcp) tests=$slow_ncacn_ip_tcp_tests ;; + esac + for t in $tests; do + plantest "$t on $transport with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" + done + done +done + + +# Tests for the NET API + +net=`$samba4bindir/smbtorture --list | grep ^NET-` + +for t in $net; do + plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS "\$SERVER[$VALIDATE]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" $t "$*" +done + +# Tests for session keys + +bindoptions="" +transport="ncacn_np" +for ntlmoptions in \ + "-k no --option=usespnego=yes" \ + "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no" \ + "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes" \ + "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no" \ + "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \ + "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no" \ + "-k no --option=usespnego=yes --option=clientntlmv2auth=yes" \ + "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no" \ + "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \ + "-k no --option=usespnego=no --option=clientntlmv2auth=yes" \ + "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes" \ + "-k no --option=usespnego=no"; do + name="RPC-SECRETS on $transport with $bindoptions with $ntlmoptions" + plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=gensec:target_hostname=\$NETBIOSNAME RPC-SECRETS "$*" +done +plantest "RPC-SECRETS on $transport with $bindoptions with Kerberos" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS "$*" +plantest "RPC-SECRETS on $transport with $bindoptions with Kerberos - use target principal" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=clientusespnegoprincipal=yes" "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS "$*" + plantest "RPC-SECRETS on $transport with Kerberos - use Samba3 style login" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" "$*" + plantest "RPC-SECRETS on $transport with Kerberos - use Samba3 style login, use target principal" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=clientusespnegoprincipal=yes" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" "$*" + +# Echo tests +transports="ncacn_np ncacn_ip_tcp ncalrpc" + +for transport in $transports; do + for bindoptions in connect spnego spnego,sign spnego,seal $VALIDATE padcheck bigendian bigendian,seal; do + for ntlmoptions in \ + "--option=socket:testnonblock=True --option=torture:quick=yes"; do + plantest "RPC-ECHO on $transport with $bindoptions and $ntlmoptions" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" RPC-ECHO "$*" + done + done +done + +for transport in $transports; do + for bindoptions in sign seal; do + for ntlmoptions in \ + "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes" \ + "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes" \ + "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \ + "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \ + "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ + "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ + "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ + "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes" \ + "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ + ; do + plantest "RPC-ECHO on $transport with $bindoptions and $ntlmoptions" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*" + done + done +done + +plantest "RPC-ECHO on ncacn_np over smb2" dc $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$SERVER[smb2]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*" + +# Tests against the NTVFS POSIX backend +smb2=`$samba4bindir/smbtorture --list | grep "^SMB2-" | xargs` +raw=`$samba4bindir/smbtorture --list | grep "^RAW-" | xargs` +base=`$samba4bindir/smbtorture --list | grep "^BASE-" | xargs` + +for t in $base $raw $smb2; do + plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD" $t +done + +# Tests against the NTVFS CIFS backend +for t in $base $raw; do + plantest "ntvfs/cifs $t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" $t +done + +# Local tests + +for t in `$samba4bindir/smbtorture --list | grep "^LOCAL-" | xargs`; do + plantest "$t" none $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncalrpc: $t "$*" +done + +if test -f $samba4bindir/tdbtorture +then + plantest "tdb stress" none $VALGRIND $samba4bindir/tdbtorture +fi + +# Pidl tests + +if test x"${PIDL_TESTS_SKIP}" = x"yes"; then + echo "Skipping pidl tests - PIDL_TESTS_SKIP=yes" +elif $PERL -e 'eval require Test::More;' > /dev/null 2>&1; then + for f in $samba4srcdir/pidl/tests/*.pl; do + plantest "pidl/`basename $f`" none $PERL $f "|" $samba4srcdir/script/harness2subunit.pl + done +else + echo "Skipping pidl tests - Test::More not installed" +fi + +# Blackbox Tests: +# tests that interact directly with the command-line tools rather than using +# the API + +bbdir=$incdir/../../testprogs/blackbox + +plantest "blackbox.smbclient" dc $bbdir/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" +plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" +plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" +plantest "blackbox.nmblookup:dc" dc $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" +plantest "blackbox.nmblookup:member" member $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" + +# Tests using the "Simple" NTVFS backend + +for t in "BASE-RW1"; do + plantest "ntvfs/simple $t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$SERVER/simple -U"\$USERNAME"%"\$PASSWORD" $t +done + +DATADIR=$samba4srcdir/../testdata + +plantest "parse samba3" none $samba4bindir/smbscript $DATADIR/samba3/verify $CONFIGURATION $DATADIR/samba3 +plantest "samba3sam.js" none $SCRIPTDIR/samba3sam.js $CONFIGURATION `pwd` $DATADIR/samba3/ + +rm -rf $PREFIX/upgrade +mkdir -p $PREFIX/upgrade +#plantest "upgrade" none $samba4bindir/smbscript setup/upgrade $CONFIGURATION --verify --targetdir=$PREFIX ../testdata/samba3 ../testdata/samba3/smb.conf + +# Domain Member Tests + +plantest "RPC-ECHO against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" RPC-ECHO "$*" +plantest "RPC-ECHO against member server with domain creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" RPC-ECHO "$*" +plantest "RPC-SAMR against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR" "$*" +plantest "RPC-SAMR-USERS against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-USERS" "$*" +plantest "RPC-SAMR-PASSWORDS against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-PASSWORDS" "$*" +plantest "wbinfo -a against member server with domain creds" member $VALGRIND $samba4bindir/wbinfo -a "\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" + +NBT_TESTS=`$samba4bindir/smbtorture --list | grep "^NBT-" | xargs` + +for f in $NBT_TESTS; do + plantest "$f:$env" "dc" $samba4bindir/smbtorture $TORTURE_OPTIONS //\$SERVER/_none_ $f -U\$USERNAME%\$PASSWORD +done + +WB_OPTS="${TORTURE_OPTIONS}" +WB_OPTS="${WB_OPTS} --option=\"torture:strict mode=yes\"" +WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\"" +WB_OPTS="${WB_OPTS} --option=\"torture:winbindd separator=\\\\\"" +WB_OPTS="${WB_OPTS} --option=\"torture:winbindd private pipe dir=\$WINBINDD_PRIV_PIPE_DIR\"" +WB_OPTS="${WB_OPTS} --option=\"torture:winbindd netbios name=\$SERVER\"" +WB_OPTS="${WB_OPTS} --option=\"torture:winbindd netbios domain=\$DOMAIN\"" + +WINBIND_STRUCT_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-STRUCT" | xargs` +WINBIND_NDR_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-NDR" | xargs` +for env in dc member; do + for t in $WINBIND_STRUCT_TESTS; do + plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t + done + + for t in $WINBIND_NDR_TESTS; do + plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t + done +done + +# Tests for SWIG +# export PYTHONPATH=lib/tdb/swig:lib/ldb/swig:scripting/swig:$PYTHONPATH +# export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH + +# plantest "tdb wrappers" scripting/swig/torture/torture_tdb.py +# plantest "ldb wrappers" scripting/swig/torture/torture_ldb.py + +if test -f $samba4bindir/nsstest +then + plantest "NSS-TEST using winbind" member $VALGRIND $samba4bindir/nsstest $samba4bindir/shared/libnss_winbind.so +fi diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl index 634b1bb4fe3..725e1dc1537 100755 --- a/source4/selftest/selftest.pl +++ b/source4/selftest/selftest.pl @@ -13,7 +13,7 @@ selftest - Samba test runner selftest --help -selftest [--srcdir=DIR] [--builddir=DIR] [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--one] [--prefix=prefix] [--immediate] [--testlist=FILE] [TESTS] +selftest [--srcdir=DIR] [--builddir=DIR] [--target=samba4|samba3|win] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--immediate] [--testlist=FILE] [TESTS] =head1 DESCRIPTION @@ -72,12 +72,19 @@ 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. -=item I<--skip> +=item I<--exclude> -Specify a file containing a list of tests that should be skipped. Possible candidates are -tests that segfault the server, flip or don't end. The format of this file is the same as +Specify a file containing a list of tests that should be skipped. Possible +candidates are tests that segfault the server, flip or don't end. The format of this file is the same as for the --expected-failures flag. +=item I<--include> + +Specify a file containing a list of tests that should be run. Same format +as the --exclude flag. + +Not includes specified means all tests will be run. + =item I<--one> Abort as soon as one test fails. @@ -137,7 +144,8 @@ my $opt_socket_wrapper_keep_pcap = undef; my $opt_one = 0; my $opt_immediate = 0; my $opt_expected_failures = undef; -my @opt_skip = (); +my @opt_exclude = (); +my @opt_include = (); my $opt_verbose = 0; my $opt_testenv = 0; my $ldap = undef; @@ -146,14 +154,15 @@ my $opt_resetup_env = undef; my $opt_bindir = undef; my $opt_no_lazy_setup = undef; my $opt_format = "plain"; -my @opt_testlists = (); +my @testlists = (); my $srcdir = "."; my $builddir = "."; my $prefix = "./st"; my @expected_failures = (); -my @skips = (); +my @includes = (); +my @excludes = (); my $statistics = { START_TIME => time(), @@ -193,7 +202,16 @@ sub expecting_failure($) sub skip($) { my ($name) = @_; - return find_in_list(\@skips, $name); + + my $reason = find_in_list(\@excludes, $name); + + return $reason if $reason; + + return undef unless ($#includes > -1); + + return "not included" if (not find_in_list(\@includes, $name)); + + return undef; } sub getlog_env($); @@ -322,7 +340,8 @@ my $result = GetOptions ( 'one' => \$opt_one, 'immediate' => \$opt_immediate, 'expected-failures=s' => \$opt_expected_failures, - 'skip=s' => \@opt_skip, + 'exclude=s' => \@opt_exclude, + 'include=s' => \@opt_include, 'srcdir=s' => \$srcdir, 'builddir=s' => \$builddir, 'verbose' => \$opt_verbose, @@ -333,7 +352,7 @@ my $result = GetOptions ( 'resetup-environment' => \$opt_resetup_env, 'bindir:s' => \$opt_bindir, 'format=s' => \$opt_format, - 'testlist=s' => \@opt_testlists + 'testlist=s' => \@testlists ); exit(1) if (not $result); @@ -466,8 +485,16 @@ if (defined($opt_expected_failures)) { @expected_failures = read_test_regexes($opt_expected_failures); } -foreach (@opt_skip) { - push (@skips, read_test_regexes($_)); +foreach (@opt_exclude) { + push (@excludes, read_test_regexes($_)); +} + +if ($opt_quick) { + push (@includes, read_test_regexes("samba4-quick")); +} + +foreach (@opt_include) { + push (@includes, read_test_regexes($_)); } my $interfaces = join(',', ("127.0.0.6/8", @@ -580,13 +607,11 @@ sub read_testlist($) return @ret; } -if ($opt_quick) { - @todo = read_testlist("$testsdir/tests_quick.sh|"); -} else { - @todo = read_testlist("$testsdir/tests_all.sh|"); +if ($#testlists == -1) { + die("No testlists specified"); } -foreach (@opt_testlists) { +foreach (@testlists) { push(@todo, read_testlist($_)); } diff --git a/source4/selftest/test_echo.sh b/source4/selftest/test_echo.sh deleted file mode 100755 index 38bbec4f4e4..00000000000 --- a/source4/selftest/test_echo.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -incdir=`dirname $0` -. $incdir/test_functions.sh - -transports="ncacn_np ncacn_ip_tcp ncalrpc" - -for transport in $transports; do - for bindoptions in connect spnego spnego,sign spnego,seal $VALIDATE padcheck bigendian bigendian,seal; do - for ntlmoptions in \ - "--option=socket:testnonblock=True --option=torture:quick=yes"; do - name="RPC-ECHO on $transport with $bindoptions and $ntlmoptions" - plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" RPC-ECHO "$*" - done - done -done - -for transport in $transports; do - for bindoptions in sign seal; do - for ntlmoptions in \ - "--option=ntlmssp_client:ntlm2=yes --option=torture:quick=yes" \ - "--option=ntlmssp_client:ntlm2=no --option=torture:quick=yes" \ - "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \ - "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:128bit=no --option=torture:quick=yes" \ - "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ - "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ - "--option=clientntlmv2auth=yes --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ - "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=yes --option=torture:quick=yes" \ - "--option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:keyexchange=no --option=torture:quick=yes" \ - ; do - name="RPC-ECHO on $transport with $bindoptions and $ntlmoptions" - plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*" - done - done -done - -name="RPC-ECHO on ncacn_np over smb2" -plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$SERVER[smb2]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*" diff --git a/source4/selftest/test_ejs.sh b/source4/selftest/test_ejs.sh deleted file mode 100755 index 86ea6cd8c90..00000000000 --- a/source4/selftest/test_ejs.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# test some simple EJS operations - -CONFIGURATION="$*" - -incdir=`dirname $0` -. $incdir/test_functions.sh - -SCRIPTDIR=$samba4srcdir/../testprogs/ejs -DATADIR=$samba4srcdir/../testdata - -plantest "base.js" dc "$SCRIPTDIR/base.js" $CONFIGURATION -plantest "samr.js" dc "$SCRIPTDIR/samr.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD -plantest "echo.js" dc "$SCRIPTDIR/echo.js" $CONFIGURATION ncalrpc: -U\$USERNAME%\$PASSWORD -#plantest "ejsnet.js" dc "$SCRIPTDIR/ejsnet.js" $CONFIGURATION -U\$USERNAME%\$PASSWORD \$DOMAIN ejstestuser -plantest "ldb.js" none "$SCRIPTDIR/ldb.js" `pwd` $CONFIGURATION -plantest "samba3sam.js" none $SCRIPTDIR/samba3sam.js $CONFIGURATION `pwd` $DATADIR/samba3/ -plantest "winreg" dc $samba4srcdir/scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U\$USERNAME%\$PASSWORD diff --git a/source4/selftest/test_functions.sh b/source4/selftest/test_functions.sh deleted file mode 100755 index 1983760c648..00000000000 --- a/source4/selftest/test_functions.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -plantest() { - name=$1 - env=$2 - shift 2 - cmdline="$*" - echo "-- TEST --" - echo $name - echo $env - echo $cmdline -} - -samba4srcdir=$incdir/.. -samba4bindir=$samba4srcdir/bin diff --git a/source4/selftest/test_ldap.sh b/source4/selftest/test_ldap.sh deleted file mode 100755 index 85c3f959159..00000000000 --- a/source4/selftest/test_ldap.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# test some simple LDAP and CLDAP operations - -incdir=`dirname $0` -. $incdir/test_functions.sh - -for options in "" "--option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD --option=socket:testnonblock=true" "-U\$USERNAME%\$PASSWORD"; do - plantest "TESTING PROTOCOL ldap with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldap \$SERVER_IP $options -done -# see if we support ldaps -if grep ENABLE_GNUTLS.1 include/config.h > /dev/null; then - for options in "" "-U\$USERNAME%\$PASSWORD"; do - plantest "TESTING PROTOCOL ldaps with options $options" dc $samba4srcdir/../testprogs/blackbox/test_ldb.sh ldaps \$SERVER_IP $options - done -fi -for t in LDAP-CLDAP LDAP-BASIC LDAP-SCHEMA LDAP-UPTODATEVECTOR -do - plantest "$t" dc $samba4bindir/smbtorture $TORTURE_OPTIONS "-U\$USERNAME%\$PASSWORD" //\$SERVER_IP/_none_ $t -done - -# only do the ldb tests when not in quick mode - they are quite slow, and ldb -# is now pretty well tested by the rest of the quick tests anyway -test "$TORTURE_QUICK" = "yes" || { - LDBDIR=$samba4srcdir/lib/ldb - export LDBDIR - plantest "ldb" none $LDBDIR/tests/test-tdb.sh -} - -SCRIPTDIR=$samba4srcdir/../testprogs/ejs - -plantest "ejs ldap" dc $SCRIPTDIR/ldap.js $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD diff --git a/source4/selftest/test_nbt.sh b/source4/selftest/test_nbt.sh deleted file mode 100755 index 22062d5d447..00000000000 --- a/source4/selftest/test_nbt.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# test some NBT/WINS operations - -incdir=`dirname $0` -. $incdir/test_functions.sh - -TEST_NBT_ENVNAME=$1 -if test x"$TEST_NBT_ENVNAME" = x"";then - TEST_NBT_ENVNAME="dc" -fi - -NBT_TESTS=`$samba4bindir/smbtorture --list | grep "^NBT-" | xargs` - -if test x"$TEST_NBT_ENVNAME" = x"dc";then - for f in $NBT_TESTS; do - plantest "$f:$TEST_NBT_ENVNAME" $TEST_NBT_ENVNAME $samba4bindir/smbtorture $TORTURE_OPTIONS //\$SERVER/_none_ $f -U\$USERNAME%\$PASSWORD - done -fi diff --git a/source4/selftest/test_nss.sh b/source4/selftest/test_nss.sh deleted file mode 100755 index 689d1038f1a..00000000000 --- a/source4/selftest/test_nss.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -incdir=`dirname $0` -. $incdir/test_functions.sh - -if [ ! -f $samba4bindir/nsstest ]; then - exit 0 -fi - -plantest "NSS-TEST using winbind" member $VALGRIND $samba4bindir/nsstest $samba4bindir/shared/libnss_winbind.so - diff --git a/source4/selftest/test_rpc.sh b/source4/selftest/test_rpc.sh deleted file mode 100755 index 3ac4e3de664..00000000000 --- a/source4/selftest/test_rpc.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# add tests to this list as they start passing, so we test -# that they stay passing -ncacn_np_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-SAMSYNC RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-LSA RPC-BINDSAMBA3 RPC-NETLOGSAMBA3 RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" -ncalrpc_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-DRSUAPI RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" -ncacn_ip_tcp_tests="RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-DSSYNC RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT" -slow_ncacn_np_tests="RPC-SAMLOGON RPC-SAMR RPC-SAMR-USERS RPC-SAMR-PASSWORDS" -slow_ncalrpc_tests="RPC-SAMR RPC-SAMR-PASSWORDS" -slow_ncacn_ip_tcp_tests="RPC-SAMR RPC-SAMR-PASSWORDS RPC-CRACKNAMES" - -incdir=`dirname $0` -. $incdir/test_functions.sh - -all_tests="$ncalrpc_tests $ncacn_np_tests $ncacn_ip_tcp_tests $slow_ncalrpc_tests $slow_ncacn_np_tests $slow_ncacn_ip_tcp_tests RPC-SECRETS RPC-SAMBA3-SHARESEC" - -# Make sure all tests get run -for t in `$samba4bindir/smbtorture --list | grep "^RPC-"` -do - echo $all_tests | grep $t > /dev/null - if [ $? -ne 0 ] - then - auto_rpc_tests="$auto_rpc_tests $t" - fi -done - -for bindoptions in seal,padcheck $VALIDATE bigendian; do - for transport in ncalrpc ncacn_np ncacn_ip_tcp; do - case $transport in - ncalrpc) tests=$ncalrpc_tests ;; - ncacn_np) tests=$ncacn_np_tests ;; - ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;; - esac - for t in $tests; do - name="$t on $transport with $bindoptions" - plantest "$name" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" - done - plantest "RPC-SAMBA3-SHARESEC on $transport with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=torture:share=tmp $t "$*" - done -done - -for bindoptions in "" $VALIDATE bigendian; do - for t in $auto_rpc_tests; do - plantest "$t with $bindoptions" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS "\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" - done -done - -for bindoptions in connect $VALIDATE ; do - for transport in ncalrpc ncacn_np ncacn_ip_tcp; do - case $transport in - ncalrpc) tests=$slow_ncalrpc_tests ;; - ncacn_np) tests=$slow_ncacn_np_tests ;; - ncacn_ip_tcp) tests=$slow_ncacn_ip_tcp_tests ;; - esac - for t in $tests; do - name="$t on $transport with $bindoptions" - plantest "$name" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" - done - done -done - diff --git a/source4/selftest/test_s3upgrade.sh b/source4/selftest/test_s3upgrade.sh deleted file mode 100755 index 692199acda8..00000000000 --- a/source4/selftest/test_s3upgrade.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -PREFIX=$1 - -if [ -z "$PREFIX" ] -then - echo "Usage: test_s3upgrade.sh <prefix>" - exit 1 -fi - -mkdir -p $PREFIX -rm -f $PREFIX/* - -incdir=`dirname $0` -. $incdir/test_functions.sh - -SCRIPTDIR=$samba4srcdir/../testprogs/ejs -DATADIR=$samba4srcdir/../testdata - -plantest "parse samba3" none $samba4bindir/smbscript $DATADIR/samba3/verify $CONFIGURATION $DATADIR/samba3 -#plantest "upgrade" none $samba4bindir/smbscript setup/upgrade $CONFIGURATION --verify --targetdir=$PREFIX ../testdata/samba3 ../testdata/samba3/smb.conf diff --git a/source4/selftest/test_session_key.sh b/source4/selftest/test_session_key.sh deleted file mode 100755 index 93be4f99f28..00000000000 --- a/source4/selftest/test_session_key.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -incdir=`dirname $0` -. $incdir/test_functions.sh - -transport="ncacn_np" -for ntlmoptions in \ - "-k no --option=usespnego=yes" \ - "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no" \ - "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes" \ - "-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no" \ - "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \ - "-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no" \ - "-k no --option=usespnego=yes --option=clientntlmv2auth=yes" \ - "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no" \ - "-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \ - "-k no --option=usespnego=no --option=clientntlmv2auth=yes" \ - "-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes" \ - "-k no --option=usespnego=no"; do - name="RPC-SECRETS on $transport with $bindoptions with $ntlmoptions" - plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" $ntlmoptions -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN --option=gensec:target_hostname=\$NETBIOSNAME RPC-SECRETS "$*" -done -name="RPC-SECRETS on $transport with $bindoptions with Kerberos" -plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS "$*" -name="RPC-SECRETS on $transport with $bindoptions with Kerberos - use target principal" -plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -k yes -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN "--option=clientusespnegoprincipal=yes" "--option=gensec:target_hostname=\$NETBIOSNAME" RPC-SECRETS "$*" -name="RPC-SECRETS on $transport with Kerberos - use Samba3 style login" - plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" "$*" -name="RPC-SECRETS on $transport with Kerberos - use Samba3 style login, use target principal" - plantest "$name" dc $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER" -k yes -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" "--option=clientusespnegoprincipal=yes" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" "--option=gensec:target_hostname=\$NETBIOSNAME" "RPC-SECRETS-none*" "$*" diff --git a/source4/selftest/test_swig.sh b/source4/selftest/test_swig.sh deleted file mode 100755 index 9f5e7c0ebf0..00000000000 --- a/source4/selftest/test_swig.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -if [ $# -ne 0 ]; then - cat <<EOF -Usage: test_swig.sh -EOF - exit 1; -fi - -incdir=`dirname $0` -. $incdir/test_functions.sh - -export PYTHONPATH=lib/tdb/swig:lib/ldb/swig:scripting/swig:$PYTHONPATH -export LD_LIBRARY_PATH=bin:$LD_LIBRARY_PATH - -echo Testing tdb wrappers -scripting/swig/torture/torture_tdb.py - -echo Testing ldb wrappers -scripting/swig/torture/torture_ldb.py diff --git a/source4/selftest/test_winbind.sh b/source4/selftest/test_winbind.sh deleted file mode 100755 index 832d12c4112..00000000000 --- a/source4/selftest/test_winbind.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# - -incdir=`dirname $0` -. $incdir/test_functions.sh - -ENVNAME=$1 -if test x"$ENVNAME" = x"";then - ENVNAME="dc" -fi - -WB_OPTS="${TORTURE_OPTIONS}" -WB_OPTS="${WB_OPTS} --option=\"torture:strict mode=yes\"" -WB_OPTS="${WB_OPTS} --option=\"torture:timelimit=1\"" -WB_OPTS="${WB_OPTS} --option=\"torture:winbindd separator=\\\\\"" -WB_OPTS="${WB_OPTS} --option=\"torture:winbindd private pipe dir=\$WINBINDD_PRIV_PIPE_DIR\"" -WB_OPTS="${WB_OPTS} --option=\"torture:winbindd netbios name=\$SERVER\"" -WB_OPTS="${WB_OPTS} --option=\"torture:winbindd netbios domain=\$DOMAIN\"" - -STRUCT_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-STRUCT" | xargs` -for t in $STRUCT_TESTS; do - plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t -done - -NDR_TESTS=`$samba4bindir/smbtorture --list | grep "^WINBIND-NDR" | xargs` -for t in $NDR_TESTS; do - plantest "$ENVNAME:$t" $ENVNAME $samba4bindir/smbtorture $WB_OPTS //_none_/_none_ $t -done diff --git a/source4/selftest/tests_all.sh b/source4/selftest/tests_all.sh deleted file mode 100755 index dc4305f23db..00000000000 --- a/source4/selftest/tests_all.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -if [ ! -n "$PERL" ] -then - PERL=perl -fi - -incdir=`dirname $0` -. $incdir/test_functions.sh - -$incdir/../bin/smbtorture -V - -$SRCDIR/selftest/test_ejs.sh $CONFIGURATION -$SRCDIR/selftest/test_ldap.sh -$SRCDIR/selftest/test_nbt.sh "dc" -$SRCDIR/selftest/test_winbind.sh "dc" -$SRCDIR/selftest/test_rpc.sh - -# Tests for the NET API - -net=`$samba4bindir/smbtorture --list | grep ^NET-` - -for t in $net; do - plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS "\$SERVER[$VALIDATE]" -U"\$USERNAME"%"\$PASSWORD" -W "\$DOMAIN" $t "$*" -done - -$SRCDIR/selftest/test_session_key.sh -$SRCDIR/selftest/test_echo.sh - -# Tests against the NTVFS POSIX backend -smb2=`$samba4bindir/smbtorture --list | grep "^SMB2-" | xargs` -raw=`$samba4bindir/smbtorture --list | grep "^RAW-" | xargs` -base=`$samba4bindir/smbtorture --list | grep "^BASE-" | xargs` - -for t in $base $raw $smb2; do - plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD" $t -done - -# Tests against the NTVFS CIFS backend -for t in $base $raw; do - plantest "ntvfs/cifs $t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" $t -done - -# Local tests - -for t in `$samba4bindir/smbtorture --list | grep "^LOCAL-" | xargs`; do - plantest "$t" none $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncalrpc: $t "$*" -done - -if test -f $samba4bindir/tdbtorture -then - plantest "tdb stress" none $VALGRIND $samba4bindir/tdbtorture -fi - -# Pidl tests - -if test x"${PIDL_TESTS_SKIP}" = x"yes"; then - echo "Skipping pidl tests - PIDL_TESTS_SKIP=yes" -elif $PERL -e 'eval require Test::More;' > /dev/null 2>&1; then - for f in $samba4srcdir/pidl/tests/*.pl; do - plantest "pidl/`basename $f`" none $PERL $f "|" $samba4srcdir/script/harness2subunit.pl - done -else - echo "Skipping pidl tests - Test::More not installed" -fi - -# Blackbox Tests: -# tests that interact directly with the command-line tools rather than using -# the API - -bbdir=$incdir/../../testprogs/blackbox - -plantest "blackbox.smbclient" dc $bbdir/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" -plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" -plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" -plantest "blackbox.nmblookup:dc" dc $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" -plantest "blackbox.nmblookup:member" member $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" - -# Tests using the "Simple" NTVFS backend - -for t in "BASE-RW1"; do - plantest "ntvfs/simple $t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$SERVER/simple -U"\$USERNAME"%"\$PASSWORD" $t -done - -$SRCDIR/selftest/test_s3upgrade.sh $PREFIX/upgrade - -# Domain Member Tests - -plantest "RPC-ECHO against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" RPC-ECHO "$*" -plantest "RPC-ECHO against member server with domain creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" RPC-ECHO "$*" -plantest "RPC-SAMR against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR" "$*" -plantest "RPC-SAMR-USERS against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-USERS" "$*" -plantest "RPC-SAMR-PASSWORDS against member server with local creds" member $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS ncacn_np:"\$NETBIOSNAME" -U"\$NETBIOSNAME/\$USERNAME"%"\$PASSWORD" "RPC-SAMR-PASSWORDS" "$*" -plantest "wbinfo -a against member server with domain creds" member $VALGRIND $samba4bindir/wbinfo -a "\$DOMAIN/\$DC_USERNAME"%"\$DC_PASSWORD" - -$SRCDIR/selftest/test_nbt.sh "member" -$SRCDIR/selftest/test_winbind.sh "member" diff --git a/source4/selftest/tests_quick.sh b/source4/selftest/tests_quick.sh deleted file mode 100755 index c05185afad6..00000000000 --- a/source4/selftest/tests_quick.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -ADDARGS="$*" - -incdir=`dirname $0` -. $incdir/test_functions.sh - -$incdir/../bin/smbtorture -V - -TORTURE_QUICK="yes" -export TORTURE_QUICK - -$SRCDIR/selftest/test_ejs.sh $CONFIGURATION -$SRCDIR/selftest/test_ldap.sh -$SRCDIR/selftest/test_nbt.sh - -tests="BASE-UNLINK BASE-ATTR BASE-DELETE" -tests="$tests BASE-TCON BASE-OPEN" -tests="$tests BASE-CHKPATH RAW-QFSINFO RAW-QFILEINFO RAW-SFILEINFO" -tests="$tests RAW-MKDIR RAW-SEEK RAW-OPEN RAW-WRITE" -tests="$tests RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-RENAME" -tests="$tests RAW-EAS RAW-STREAMS" - -for t in $tests; do - plantest "$t" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$SERVER/tmp -U"\$USERNAME"%"\$PASSWORD" $t -done - -plantest "ntvfs/cifs BASE-OPEN" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $ADDARGS //\$NETBIOSNAME/cifs -U"\$USERNAME"%"\$PASSWORD" BASE-OPEN - -# add tests to this list as they start passing, so we test -# that they stay passing -ncacn_np_tests="RPC-ALTERCONTEXT RPC-JOIN RPC-ECHO RPC-SCHANNEL RPC-NETLOGON RPC-UNIXINFO RPC-HANDLES" -ncacn_ip_tcp_tests="RPC-ALTERCONTEXT RPC-JOIN RPC-ECHO RPC-HANDLES" -ncalrpc_tests="RPC-ECHO" - -for bindoptions in seal,padcheck $VALIDATE bigendian; do - for transport in ncalrpc ncacn_np ncacn_ip_tcp; do - case $transport in - ncalrpc) tests=$ncalrpc_tests ;; - ncacn_np) tests=$ncacn_np_tests ;; - ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;; - esac - for t in $tests; do - name="$t on $transport with $bindoptions" - plantest "$name" dc $VALGRIND $samba4bindir/smbtorture $TORTURE_OPTIONS $transport:"\$SERVER[$bindoptions]" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*" - done - done -done |