tmpeditor=$(mktemp --suffix .sh -p $SELFTEST_TMPDIR samba-tool-editor-XXXXXXXX)
chmod +x $tmpeditor
+TEST_MACHINE="$(mktemp -u testmachineXXXXXX)"
+
create_test_computer()
{
$PYTHON ${STpath}/source4/scripting/bin/samba-tool \
- computer create testmachine1 \
+ computer create ${TEST_MACHINE} \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool \
- computer edit testmachine1 --editor=$tmpeditor \
+ computer edit ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \
- testmachine1 --editor=$tmpeditor \
+ ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
get_attribute_base64()
{
- ${ldbsearch} '(sAMAccountName=testmachine1$)' displayName \
+ ${ldbsearch} "(sAMAccountName=${TEST_MACHINE}\$)" displayName \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
mv \${computer_ldif}.tmp \$computer_ldif
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \
- testmachine1 --editor=$tmpeditor \
+ ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
mv \${computer_ldif}.tmp \$computer_ldif
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \
- testmachine1 --editor=$tmpeditor \
+ ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
get_attribute_base64_control()
{
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \
- testmachine1 --attributes=displayName \
+ ${TEST_MACHINE} --attributes=displayName \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
{
# LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here.
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \
- testmachine1 --attributes=displayName \
+ ${TEST_MACHINE} --attributes=displayName \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
\$computer_ldif
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \
- testmachine1 --editor=$tmpeditor \
+ ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
EOF
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \
- testmachine1 --editor=$tmpeditor \
+ ${TEST_MACHINE} --editor=$tmpeditor \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
get_changed_attribute_force_no_base64()
{
$PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \
- testmachine1 --attributes=displayName \
+ ${TEST_MACHINE} --attributes=displayName \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}
delete_computer()
{
$PYTHON ${STpath}/source4/scripting/bin/samba-tool \
- computer delete testmachine1 \
+ computer delete ${TEST_MACHINE} \
-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
}