Running tests on FreeBSD

Uri Simchoni uri at samba.org
Mon Nov 27 05:36:15 UTC 2017


Adding Andrew who is much more qualified than I to answer.

I couldn't quite understand the commands you use to configure, build,
and test. It looks like you tried autobuild.py. I would start with a
simple "make test" (after configuring and building).

If you want to avoid Python3 either:
- Don't use autobuild and configure without the --extra-python
- Set AUTOBUILD_NO_EXTRA_PYTHON=1 in the environment and run autobuild.

Python2 is required AFAIK. Also AFAIK, not 100% sure, --extra-python is
about building Python extensions (.so) *also* for Python3, and probably
running the relevant tests, but the build system as a whole is Python2.

I'm not sure it's a good idea to run make test with the production build
configuration in terms of --prefix and other directories, as it collides
with production Samba that might be running on the same machine.

I found the following presentations helpful when dealing with Samba test
infrastructure:
https://www.youtube.com/watch?v=EZIUxFgneoo
https://www.samba.org/~asn/sambaxp-2015-andreas_schneider-selftest.pdf

Lastly, I do intend to go into the testing phase, but admittedly I'm
doing it at my own pace.

Hope that helps,
Uri.

On 11/27/2017 06:45 AM, Timur I. Bakeyev wrote:
> Hi, Uri!
> 
> Thanks to your patches I'm able now to build code from master within
> FreeBSD ports infrastructure. That's possibly not exactly how you build
> in on autobuild, but as 99% of the FreeBSD users do build Samba from the
> ports I think it has sense to test in the exactly same environment.
> 
> At the moment we are building with something like this:
> --mandir="/usr/local/man"  --sysconfdir="/usr/local/etc" 
> --includedir="/usr/local/include/samba4" 
> --datadir="/usr/local/share/samba4"  --libdir="/usr/local/lib/samba4" 
> --with-privatelibdir="/usr/local/lib/samba4/private" 
> --with-pammodulesdir="/usr/local/lib" 
> --with-modulesdir="/usr/local/lib/shared-modules" 
> --with-pkgconfigdir="/usr/local/libdata/pkgconfig" 
> --localstatedir="/var"  --with-piddir="/var/run/samba4" 
> --with-sockets-dir="/var/run/samba4" 
> --with-privileged-socket-dir="/var/run/samba4" 
> --with-lockdir="/var/db/samba4"  --with-statedir="/var/db/samba4" 
> --with-cachedir="/var/db/samba4" 
> --with-bind-dns-dir=/var/db/samba4/bind-dns 
> --with-privatedir="/var/db/samba4/private" 
> --with-logfilebase="/var/log/samba4" --with-pam  --with-iconv 
> --with-winbind  --disable-rpath  --without-gettext 
> --enable-pthreadpool  --with-acl-support  --with-sendfile-support  
> --with-ads --with-dnsupdate --accel-aes=intelaesni --disable-cups
> --disable-iprint --verbose --enable-debug --enable-developer
> --enable-selftest --abi-check-disable --with-fam --with-ldap
> --with-ntvfs-fileserver --with-profiling-data --with-quotas
> --with-syslog --with-utmp --disable-dnssd --disable-avahi
> --bundled-libraries="!cmocka,!talloc,!tevent,!tdb,!ldb,com_err"
> --with-shared-modules="idmap_ldap,idmap_nss,idmap_autorid,idmap_rid,idmap_hash,idmap_tdb,idmap_tdb2,idmap_script,nss_info_h
> ash,idmap_ad,idmap_rfc2307,nss_info_template,nss_info_rfc2307,nss_info_sfu,nss_info_sfu20,auth_skel,pdb_test,gpext_security,gpext_registry,gpext_scripts,perfcount_test,vfs_
> fake_dfq,vfs_skel_opaque,vfs_skel_transparent,vfs_shadow_copy_test,vfs_fake_acls,vfs_nfs4acl_xattr"
> --prefix=/usr/local  -j8 --extra-python=/usr/local/bin/python3.6
> 
> Well, apparently, at the top of all the issues with the tests having
> --extra-python breaks the tests, as it seems that tests expect
> Python2.7, but after second run of linking for the Python3.6 various
> binary modules in bin/python pointing to the 3.6 version.
> 
> test: running (/usr/local/bin/perl
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/selftest.pl
> <http://selftest.pl> --target=samba --prefix=./st
> --srcdir=/wrkdirs/usr/ports/net/
> samba4-devel/work/samba-6f8e3f7
> --exclude=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/skip
> --testlist="EXTRA_PYTHON=/usr/local/bin/python3.6 /usr/local/
> bin/python2.7
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/tests.py|"
> --testlist="EXTRA_PYTHON=/usr/local/bin/python3.6
> /usr/local/bin/python2.7 /wrkdirs
> /usr/ports/net/samba4-devel/work/samba-6f8e3f7/source3/selftest/tests.py|"
> --testlist="EXTRA_PYTHON=/usr/local/bin/python3.6
> /usr/local/bin/python2.7 /wrkdirs/usr/ports/net
> /samba4-devel/work/samba-6f8e3f7/source4/selftest/tests.py|" 
> --exclude=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/slow
> --nss_wrapper_so_path=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/third_party/nss_wrapper/libnss-wrapper.so
> --resolv_wrapper_so_path=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/third_party/resolv_wrapper/libresolv-wrapper.so
> --socket_wrapper_so_path=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/third_party/socket_wrapper/libsocket-wrapper.so
> --uid_wrapper_so_path=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/third_party/uid_wrapper/libuid-wrapper.so
> --use-dns-faking --socket-wrapper  && touch ./st/st_done) |
> /usr/local/bin/python2.7 -u
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/filter-subunit
> --expected-failures=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/knownfail
> --expected-failures=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/knownfail.d
> --flapping=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/flapping
> --flapping=/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/flapping.d
> | tee ./st/subunit | /usr/local/bin/python2.7 -u
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/format-subunit
> --prefix=./st --immediate
> Traceback (most recent call last):
>   File
> "/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/format-subunit",
> line 14, in <module>
>     import subunithelper
>   File
> "/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/subunithelper.py",
> line 24, in <module>
>     from samba import subunit
>   File "bin/python/samba/__init__.py", line 29, in <module>
>     import samba.param
> ImportError: dynamic module does not define init function (initparam)
> Traceback (most recent call last):
>   File
> "/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/filter-subunit",
> line 27, in <module>
>     import subunithelper
>   File
> "/wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/subunithelper.py",
> line 24, in <module>
>     from samba import subunit
>   File "bin/python/samba/__init__.py", line 29, in <module>
>     import samba.param
> ImportError: dynamic module does not define init function (initparam)
> skipping subunit (testscenarios not available)
> OPTIONS --configfile=$SMB_CONF_PATH --option='fss:sequence timeout=1'
> --maximum-runtime=$SELFTEST_MAXTIME --basedir=$SELFTEST_TMPDIR
> --format=subunit --option=torture:progress=no
> skipping ldb.base (Using system LDB, ldbtest not available)
> skipping tdb.stress (Using system TDB, tdbtorture not available)
> 
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/selftest.pl
> <http://selftest.pl>: PID[8797]: Got SIGPIPE teardown environments.
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/selftest/selftest.pl
> <http://selftest.pl>: PID[8797]: Exiting...
> TOP 10 slowest tests
> ERROR: test failed with exit code 1
> *** Error code 1
> 
> Checking in the bin/python/samba shows that (almost) all the modules are
> pointing to the 'extra' versions.
> 
> lrwxr-xr-x  1 nobody  wheel     77 Nov 27 04:16 ntacls.py ->
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/python/samba/ntacls.py
> lrwxr-xr-x  1 root    wheel    103 Nov 27 04:31 ntstatus.so ->
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/libcli/util/extra-python-ntstatus.so
> lrwxr-xr-x  1 root    wheel     97 Nov 27 04:31 param.so ->
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/source4/param/extra-pyparam.so
> lrwxr-xr-x  1 nobody  wheel     98 Nov 27 04:16 policy.so ->
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/source4/lib/policy/py-policy.so
> lrwxr-xr-x  1 root    wheel    113 Nov 27 04:31 posix_eadb.so ->
> /wrkdirs/usr/ports/net/samba4-devel/work/samba-6f8e3f7/bin/default/source4/ntvfs/posix/extra-python-posix-eadb.so
> 
> I suspect that there could be an extra option that I need to pass to the
> tests or I need to prepare test environment accordingly or, after all,
> drop build with Python3 to get tests succeed(to the extend that is
> supported now).
> 
> Can you give me a hand in setting up the test environment properly?
> 
> With best regards,
> Timur Bakeyev.
> 
> 




More information about the samba-technical mailing list