t.chdir("${PREFIX}")
t.run_cmd('killall -9 -q samba smbd nmbd winbindd', checkfail=False)
t.run_cmd(['sbin/samba',
- '--option', 'panic action=gnome-terminal -e "gdb --pid %d"', '--option', 'max protocol=nt1'])
+ '--option', 'panic action=gnome-terminal -e "gdb --pid %d"', '--option', 'max protocol=nt1'])
t.port_wait("${INTERFACE_IP}", 139)
def test_smbclient(t):
'''test that DNS is OK'''
t.info("Testing DNS")
t.cmd_contains("host -t SRV _ldap._tcp.${LCREALM}.",
- ['_ldap._tcp.${LCREALM} has SRV record 0 100 389 ${HOSTNAME}.${LCREALM}'])
+ ['_ldap._tcp.${LCREALM} has SRV record 0 100 389 ${HOSTNAME}.${LCREALM}'])
t.cmd_contains("host -t SRV _kerberos._udp.${LCREALM}.",
- ['_kerberos._udp.${LCREALM} has SRV record 0 100 88 ${HOSTNAME}.${LCREALM}'])
+ ['_kerberos._udp.${LCREALM} has SRV record 0 100 88 ${HOSTNAME}.${LCREALM}'])
t.cmd_contains("host -t A ${HOSTNAME}.${LCREALM}",
- ['${HOSTNAME}.${LCREALM} has address'])
+ ['${HOSTNAME}.${LCREALM} has address'])
def test_kerberos(t):
'''test that kerberos is OK'''
# the first replication will transfer the dnsHostname attribute
t.cmd_contains("bin/samba-tool drs replicate ${HOSTNAME}.${LCREALM} ${WIN_HOSTNAME} CN=Configuration,${BASEDN} -k yes", ["was successful"])
- for nc in [ '${BASEDN}', 'CN=Configuration,${BASEDN}', 'CN=Schema,CN=Configuration,${BASEDN}' ]:
+ for nc in ['${BASEDN}', 'CN=Configuration,${BASEDN}', 'CN=Schema,CN=Configuration,${BASEDN}']:
t.cmd_contains("bin/samba-tool drs replicate ${HOSTNAME}.${LCREALM} ${WIN_HOSTNAME}.${LCREALM} %s -k yes" % nc, ["was successful"])
t.cmd_contains("bin/samba-tool drs replicate ${WIN_HOSTNAME}.${LCREALM} ${HOSTNAME}.${LCREALM} %s -k yes" % nc, ["was successful"])
t.cmd_contains("bin/samba-tool drs showrepl ${HOSTNAME}.${LCREALM} -k yes",
- [ "INBOUND NEIGHBORS",
- "${BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${BASEDN}", # cope with either order
- "Last attempt .* was successful",
- "OUTBOUND NEIGHBORS",
- "${BASEDN}",
- "Last success",
- "CN=Configuration,${BASEDN}",
- "Last success",
- "CN=Configuration,${BASEDN}",
- "Last success"],
+ ["INBOUND NEIGHBORS",
+ "${BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${BASEDN}", # cope with either order
+ "Last attempt .* was successful",
+ "OUTBOUND NEIGHBORS",
+ "${BASEDN}",
+ "Last success",
+ "CN=Configuration,${BASEDN}",
+ "Last success",
+ "CN=Configuration,${BASEDN}",
+ "Last success"],
ordered=True,
regex=True)
t.cmd_contains("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${LCREALM} -k yes",
- [ "INBOUND NEIGHBORS",
- "${BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${BASEDN}",
- "Last attempt .* was successful",
- "OUTBOUND NEIGHBORS",
- "${BASEDN}",
- "Last success",
- "CN=Configuration,${BASEDN}",
- "Last success",
- "CN=Configuration,${BASEDN}",
- "Last success" ],
+ ["INBOUND NEIGHBORS",
+ "${BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${BASEDN}",
+ "Last attempt .* was successful",
+ "OUTBOUND NEIGHBORS",
+ "${BASEDN}",
+ "Last success",
+ "CN=Configuration,${BASEDN}",
+ "Last success",
+ "CN=Configuration,${BASEDN}",
+ "Last success"],
ordered=True,
regex=True)
child.expect("CN=Configuration,${BASEDN}")
child.expect("was successful")
- for nc in [ '${BASEDN}', 'CN=Configuration,${BASEDN}', 'CN=Schema,CN=Configuration,${BASEDN}' ]:
+ for nc in ['${BASEDN}', 'CN=Configuration,${BASEDN}', 'CN=Schema,CN=Configuration,${BASEDN}']:
t.cmd_contains("bin/samba-tool drs replicate --add-ref ${WIN_HOSTNAME}.${LCREALM} ${HOSTNAME}.${LCREALM} %s" % nc, ["was successful"])
t.cmd_contains("bin/samba-tool drs showrepl ${HOSTNAME}.${LCREALM}",
- [ "INBOUND NEIGHBORS",
- "OUTBOUND NEIGHBORS",
- "${BASEDN}",
- "Last attempt.*was successful",
- "CN=Configuration,${BASEDN}",
- "Last attempt.*was successful",
- "CN=Configuration,${BASEDN}",
- "Last attempt.*was successful" ],
+ ["INBOUND NEIGHBORS",
+ "OUTBOUND NEIGHBORS",
+ "${BASEDN}",
+ "Last attempt.*was successful",
+ "CN=Configuration,${BASEDN}",
+ "Last attempt.*was successful",
+ "CN=Configuration,${BASEDN}",
+ "Last attempt.*was successful"],
ordered=True,
regex=True)
t.setwinvars(vm)
t.info("Joining ${WIN_VM} as a second DC using samba-tool domain join DC")
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.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] )
+ t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'])
t.run_cmd('bin/samba-tool domain join ${WIN_REALM} DC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces=${INTERFACE}')
t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')
t.run_cmd('bin/samba-tool drs kcc ${HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')
t.kinit("administrator@${WIN_REALM}", "${WIN_PASS}")
- for nc in [ '${WIN_BASEDN}', 'CN=Configuration,${WIN_BASEDN}', 'CN=Schema,CN=Configuration,${WIN_BASEDN}' ]:
+ for nc in ['${WIN_BASEDN}', 'CN=Configuration,${WIN_BASEDN}', 'CN=Schema,CN=Configuration,${WIN_BASEDN}']:
t.cmd_contains("bin/samba-tool drs replicate ${HOSTNAME}.${WIN_REALM} ${WIN_HOSTNAME}.${WIN_REALM} %s -k yes" % nc, ["was successful"])
t.cmd_contains("bin/samba-tool drs replicate ${WIN_HOSTNAME}.${WIN_REALM} ${HOSTNAME}.${WIN_REALM} %s -k yes" % nc, ["was successful"])
t.setwinvars(vm)
t.info("Joining ${WIN_VM} as a RODC using samba-tool domain join DC")
t.port_wait("${WIN_IP}", 389)
- t.retry_cmd("host -t SRV _ldap._tcp.${WIN_REALM} ${WIN_IP}", ['has SRV record'] )
- t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] )
+ t.retry_cmd("host -t SRV _ldap._tcp.${WIN_REALM} ${WIN_IP}", ['has SRV record'])
+ t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'])
t.run_cmd('bin/samba-tool domain join ${WIN_REALM} RODC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces=${INTERFACE}')
t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')
t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')
t.kinit("administrator@${WIN_REALM}", "${WIN_PASS}")
- for nc in [ '${WIN_BASEDN}', 'CN=Configuration,${WIN_BASEDN}', 'CN=Schema,CN=Configuration,${WIN_BASEDN}' ]:
+ for nc in ['${WIN_BASEDN}', 'CN=Configuration,${WIN_BASEDN}', 'CN=Schema,CN=Configuration,${WIN_BASEDN}']:
t.cmd_contains("bin/samba-tool drs replicate ${HOSTNAME}.${WIN_REALM} ${WIN_HOSTNAME}.${WIN_REALM} %s -k yes" % nc, ["was successful"])
retries = 10
child.expect("DSA invocationID")
t.cmd_contains("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -k yes",
- [ "INBOUND NEIGHBORS",
- "OUTBOUND NEIGHBORS",
- "${WIN_BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${WIN_BASEDN}",
- "Last attempt .* was successful",
- "CN=Configuration,${WIN_BASEDN}",
- "Last attempt .* was successful" ],
+ ["INBOUND NEIGHBORS",
+ "OUTBOUND NEIGHBORS",
+ "${WIN_BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${WIN_BASEDN}",
+ "Last attempt .* was successful",
+ "CN=Configuration,${WIN_BASEDN}",
+ "Last attempt .* was successful"],
ordered=True,
regex=True)