First draft libsmbclient test program

Fabien Chevalier fchevali at supelec-rennes.fr
Sun Nov 3 21:04:00 GMT 2002


Hello,

I wrote this afternoon this small test program.
It does not do all what i would have liked, but it does enough to 
begin to compare libsmbclient releases.

What it tests:
  -listing workgroups
  -listing computers
  -listing shares

With an automated way

What it does not yet:
  -all what remains

I will go on and implement all what is missing if you feel it 
will be useful for you.

Attached is the output generated by various libsmbclient releases 
+ the current program sources.

The first regression is between 2.2.2 and 2.2.3
The second is somewhere i don't know, but is there in 3.0alpha20

Cheers.

Fabien.


PS:
  I can make it to dlopen libsmbclient if you need it ...but I 
use only linux and i have no idea if it will work elsewhere.

PS(2):
  What do you mean, Andrew, by making it "scriptable" ?

--------------------------------------------------------------
Samba v2.2.1

[fabien at tux libsmb]$ lsmbctest
>> Now running test smbc_init...
Calling int smbc_init(mbc_get_auth_data_fn, int debug=<0>)
Result : 0
>> Test <smbc_init> OK
>> Now running test workgroups listing...
Calling int smbc_opendir(const char *durl=<smb://>)
Authentification required for SERVER <CUTBIDISH> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <1>, named <MDKGROUP>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <1>, named <REZ>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <1>, named <WORKGROUP>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <workgroups listing> OK
>> Now running test smbc_closedir...
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Test <smbc_closedir> OK
>> Now running test machines in workgroup listing...
Calling int smbc_opendir(const char *durl=<smb://MDKGROUP>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <2>, named <SHADOW>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <machines in workgroup listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Now running test shares on a machine listing...
Calling int smbc_opendir(const char *durl=<smb://SHADOW>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <6>, named <IPC$>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a6da0, errno=0[Success]
Found entry type <3>, named <ADMIN$>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <shares on a machine listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]

Test summary:

smbc_init                               Ok
smbc_closedir                           Ok
workgroups listing                              Ok
machines in workgroup listing                           Ok
shares on a machine listing                             Ok

--------------------------------------------------------------
Samba v2.2.2

[fabien at tux libsmb]$ lsmbctest
>> Now running test smbc_init...
Calling int smbc_init(mbc_get_auth_data_fn, int debug=<0>)
Result : 0
>> Test <smbc_init> OK
>> Now running test workgroups listing...
Calling int smbc_opendir(const char *durl=<smb://>)
Authentification required for SERVER <CUTBIDISH> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <1>, named <MDKGROUP>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <1>, named <REZ>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <1>, named <WORKGROUP>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <workgroups listing> OK
>> Now running test smbc_closedir...
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Test <smbc_closedir> OK
>> Now running test machines in workgroup listing...
Calling int smbc_opendir(const char *durl=<smb://MDKGROUP>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <2>, named <SHADOW>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <machines in workgroup listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Now running test shares on a machine listing...
Calling int smbc_opendir(const char *durl=<smb://SHADOW>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <6>, named <IPC$>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400a83e0, errno=0[Success]
Found entry type <3>, named <ADMIN$>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <shares on a machine listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]

Test summary:

smbc_init                               Ok
smbc_closedir                           Ok
workgroups listing                              Ok
machines in workgroup listing                           Ok
shares on a machine listing                             Ok

--------------------------------------------------------------
Samba v2.2.3

[fabien at tux libsmb]$ lsmbctest -W MDKGROUP
>> Now running test smbc_init...
Calling int smbc_init(mbc_get_auth_data_fn, int debug=<0>)
Result : 0
>> Test <smbc_init> OK
>> Now running test workgroups listing...
Calling int smbc_opendir(const char *durl=<smb://>)
Authentification required for SERVER <CUTBIDISH> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : -1, errno=0[Success]
>> Test <workgroups listing> FAILED
>> Now running test machines in workgroup listing...
Calling int smbc_opendir(const char *durl=<smb://MDKGROUP>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b04e0, errno=0[Success]
Found entry type <2>, named <SHADOW>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <machines in workgroup listing> OK
>> Now running test smbc_closedir...
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Test <smbc_closedir> OK
>> Now running test shares on a machine listing...
Calling int smbc_opendir(const char *durl=<smb://SHADOW>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b04e0, errno=0[Success]
Found entry type <6>, named <IPC$>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b04e0, errno=0[Success]
Found entry type <3>, named <ADMIN$>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <shares on a machine listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]

Test summary:

smbc_init                               Ok
smbc_closedir                           Ok
workgroups listing                              Failed
machines in workgroup listing                           Ok
shares on a machine listing                             Ok
--------------------------------------------------------------
Samba v2.2.6

[fabien at tux libsmb]$ lsmbctest -W MDKGROUP
>> Now running test smbc_init...
Calling int smbc_init(mbc_get_auth_data_fn, int debug=<0>)
Result : 0
>> Test <smbc_init> OK
>> Now running test workgroups listing...
Calling int smbc_opendir(const char *durl=<smb://>)
Authentification required for SERVER <CUTBIDISH> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : -1, errno=0[Success]
>> Test <workgroups listing> FAILED
>> Now running test machines in workgroup listing...
Calling int smbc_opendir(const char *durl=<smb://MDKGROUP>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b3580, errno=0[Success]
Found entry type <2>, named <SHADOW>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <machines in workgroup listing> OK
>> Now running test smbc_closedir...
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]
>> Test <smbc_closedir> OK
>> Now running test shares on a machine listing...
Calling int smbc_opendir(const char *durl=<smb://SHADOW>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 11024, errno=0[Success]
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b3580, errno=0[Success]
Found entry type <6>, named <IPC$>
Calling int smbc_readdir(int dh=<11024>)
Result : 0x400b3580, errno=0[Success]
Found entry type <3>, named <ADMIN$>
Calling int smbc_readdir(int dh=<11024>)
Result : (nil), errno=0[Success]
>> Test <shares on a machine listing> OK
Calling int smbc_closedir(int dh=<11024>)
Result : 0, errno=0[Success]

Test summary:

smbc_init                               Ok
smbc_closedir                           Ok
workgroups listing                              Failed
machines in workgroup listing                           Ok
shares on a machine listing                             Ok

--------------------------------------------------------------
Samba v3.0 alpha20

[fabien at tux libsmb]$ lsmbctest -W MDKGROUP
>> Now running test smbc_init...
Calling int smbc_init(mbc_get_auth_data_fn, int debug=<0>)
Result : 0
>> Test <smbc_init> OK
>> Now running test workgroups listing...
Calling int smbc_opendir(const char *durl=<smb://>)
Authentification required for SERVER <CUTBIDISH> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : -1, errno=0[Success]
>> Test <workgroups listing> FAILED
>> Now running test machines in workgroup listing...
Calling int smbc_opendir(const char *durl=<smb://MDKGROUP>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 10000, errno=0[Success]
Calling int smbc_readdir(int dh=<10000>)
Result : 0x804aedc, errno=0[Success]
Found entry type <2>, named <SHADOW>
Calling int smbc_readdir(int dh=<10000>)
Result : (nil), errno=0[Success]
>> Test <machines in workgroup listing> OK
>> Now running test smbc_closedir...
Calling int smbc_closedir(int dh=<10000>)
Result : 0, errno=0[Success]
>> Test <smbc_closedir> OK
>> Now running test shares on a machine listing...
Calling int smbc_opendir(const char *durl=<smb://SHADOW>)
Authentification required for SERVER <SHADOW> SHARE <IPC$> in 
WORKGROUP <WORKGROUP>.
Returning <><>
Result : 10001, errno=0[Success]
Calling int smbc_readdir(int dh=<10001>)
Result : (nil), errno=2[No such file or directory]
>> Test <shares on a machine listing> FAILED
Calling int smbc_closedir(int dh=<10001>)
Result : 0, errno=2[No such file or directory]

Test summary:

smbc_init                               Ok
smbc_closedir                           Ok
workgroups listing                              Failed
machines in workgroup listing                           Ok
shares on a machine listing                             Failed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makefile
Type: text/x-makefile
Size: 156 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20021103/d7a34c9a/makefile.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsmbctest.c
Type: text/x-csrc
Size: 11004 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20021103/d7a34c9a/lsmbctest.bin


More information about the samba-technical mailing list