smbtortureの実行方法まとめ。
smbtortureとは
Writing Torture Tests - SambaWiki
https://wiki.samba.org/index.php/Writing_Torture_Tests
The smbtorture framework provided in Samba is an extremely powerful tool for exercising obscure parts of Windows protocols and determining how different server implementations, Windows among them, respond.
sambaの機能追加/不良修正とセットでsmbtortureのテストケースが
追加される、ことがある。
実行方法は上記SambaWikiRunning testsあたり。
make testで全テスト実行できる。
前準備
smbtortureの実行には、wafが必要。
samba-samba-4.1.0# make test
WAF_MAKE=1 python ./buildtools/bin/waf test
'test' finished successfully (0.014s)
Project not configured (run 'waf configure' first)
Makefile:17: recipe for target 'test' failed
make: *** [test] Error 1
samba-samba-4.1.0#
wafとは
Web Application Firewall の方ではない。
Waf is a Python-based framework for configuring, compiling and installing applications.
waf チュートリアル - 純粋関数型雑記帳
http://d.hatena.ne.jp/tanakh/20100212
waf設定
wafはsambaソースに含まれているためインストールは不要。
wafはバージョン毎の互換性があまりないらしく、
プログラムにwafを含めることが推奨されているらしい。
sambaにも含まれている。
sambaソースの以下パスにwafが格納されている。
samba-samba-4.1.0# ls buildtools/bin/
waf*
alias設定
samba-samba-4.1.0/buildtools/bin# alias waf=$PWD/waf
samba-samba-4.1.0/buildtools/bin# waf --version
waf 1.5.19 (9709M)
configure
waf configureを実行する。
samba-samba-4.1.0# waf configure
Checking for program gcc or cc : /usr/bin/gcc
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for program git : /usr/bin/git
....
Checking for new_form : ok
building regedit
Checking linker accepts -Wl,-no-undefined : yes
Checking linker accepts ['-undefined', 'dynamic_lookup'] : no
Checking linker accepts -Wl,--as-needed : yes
Checking for -lc not needed : ok
Checking configure summary : ok
Checking compiler for PIE support : yes
'configure' finished successfully (1m2.308s)
smbtorture実行
設定が完了すればsmbtortureを実行できる。
make test(全テスト実行)を実行してもいいが、
TESTS=で実行するtest suiteを絞り込める。
samba-samba-4.1.0# make test TESTS=samr
WAF_MAKE=1 python ./buildtools/bin/waf test
'test' finished successfully (0.010s)