smbd: Use share_mode_entry's lease data in delay_rename_for_lease_break()
[gd/samba-autobuild/.git] / wintest / test-s3.py
index e6dbfc75f1f57c1cacc99c6c1219cc8ee0aaea3b..1c5142bea56fc874ff64fa805898d7cd3c5cf38d 100755 (executable)
@@ -1,23 +1,24 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 '''automated testing of Samba3 against windows'''
 
-import sys, os
-import optparse
 import wintest
 
+
 def set_libpath(t):
     t.putenv("LD_LIBRARY_PATH", "${PREFIX}/lib")
 
+
 def set_krb5_conf(t):
     t.run_cmd("mkdir -p ${PREFIX}/etc")
-    t.write_file("${PREFIX}/etc/krb5.conf", 
-                    '''[libdefaults]
+    t.write_file("${PREFIX}/etc/krb5.conf",
+                 '''[libdefaults]
        dns_lookup_realm = false
        dns_lookup_kdc = true''')
 
     t.putenv("KRB5_CONFIG", '${PREFIX}/etc/krb5.conf')
 
+
 def build_s3(t):
     '''build samba3'''
     t.info('Building s3')
@@ -30,6 +31,7 @@ def build_s3(t):
     t.run_cmd('rm -rf ${PREFIX}')
     t.run_cmd('make install')
 
+
 def start_s3(t):
     t.info('Starting Samba3')
     t.chdir("${PREFIX}")
@@ -40,6 +42,7 @@ def start_s3(t):
     t.run_cmd(['sbin/smbd', "-D"])
     t.port_wait("${INTERFACE_IP}", 139)
 
+
 def test_wbinfo(t):
     t.info('Testing wbinfo')
     t.chdir('${PREFIX}')
@@ -52,7 +55,7 @@ def test_wbinfo(t):
                 casefold=True)
     t.cmd_contains("bin/wbinfo -u",
                    ["${WIN_DOMAIN}/administrator",
-                    "${WIN_DOMAIN}/krbtgt" ],
+                    "${WIN_DOMAIN}/krbtgt"],
                    casefold=True)
     t.cmd_contains("bin/wbinfo -g",
                    ["${WIN_DOMAIN}/domain users",
@@ -103,6 +106,7 @@ def test_smbclient(t):
     child.sendline("cd ..")
     child.sendline("rmdir testdir")
 
+
 def create_shares(t):
     t.info("Adding test shares")
     t.chdir('${PREFIX}')
@@ -147,17 +151,19 @@ def prep_join_as_member(t, vm):
         panic action = xterm -e gdb --pid %d
     ''')
 
+
 def join_as_member(t, vm):
     '''join a windows domain as a member server'''
     t.setwinvars(vm)
     t.info("Joining ${WIN_VM} as a member using net ads join")
     t.port_wait("${WIN_IP}", 389)
-    t.retry_cmd("host -t SRV _ldap._tcp.${WIN_REALM} ${WIN_IP}", ['has SRV record'] )
+    t.retry_cmd("host -t SRV _ldap._tcp.${WIN_REALM} ${WIN_IP}", ['has SRV record'])
     t.cmd_contains("bin/net ads join -Uadministrator%${WIN_PASS}", ["Joined"])
     t.cmd_contains("bin/net ads testjoin", ["Join is OK"])
     t.cmd_contains("bin/net ads dns register ${HOSTNAME}.${WIN_REALM} -P", ["Successfully registered hostname with DNS"])
     t.cmd_contains("host -t A ${HOSTNAME}.${WIN_REALM}",
-                 ['${HOSTNAME}.${WIN_REALM} has address'])
+                   ['${HOSTNAME}.${WIN_REALM} has address'])
+
 
 def create_root_account(t, vm):
     t.setwinvars(vm)
@@ -167,13 +173,14 @@ def create_root_account(t, vm):
     child = t.pexpect_spawn('bin/net ads password root -Uadministrator%${WIN_PASS}')
     child.expect("Enter new password for root")
     child.sendline("${PASSWORD2}")
-    child.expect("Password change for ");
+    child.expect("Password change for ")
     child.expect(" completed")
     child = t.pexpect_spawn('bin/net rpc shell -S ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}')
     child.expect("net rpc>")
     child.sendline("user edit disabled root no")
     child.expect("Set root's disabled flag")
 
+
 def test_join_as_member(t, vm):
     '''test the domain join'''
     t.setwinvars(vm)