PEP8: fix W291: trailing whitespace
[vlendec/samba-autobuild/.git] / wintest / test-s3.py
index 56fd8f9514e70ab0a0feefde524ee5c868eac29c..6e3cb9521d6904d45961e140230afdfdb7479ef5 100755 (executable)
@@ -2,22 +2,26 @@
 
 '''automated testing of Samba3 against windows'''
 
-import sys, os
+import sys
+import 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 +34,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 +45,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 +58,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 +109,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 +154,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 +176,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)
@@ -187,7 +197,7 @@ def test_s3(t):
     '''basic s3 testing'''
 
     t.setvar("SAMBA_VERSION", "Version 4")
-    t.setvar("smbclient", "bin/smbclient4")
+    t.setvar("smbclient", "bin/smbclient")
     t.check_prerequesites()
     set_libpath(t)