def set_uuid(sbox):
    "test 'svnadmin setuuid'"
    sbox.build(create_wc=False)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    orig_uuid = output[0].rstrip()
    svntest.actions.run_and_verify_svnadmin(None, '^.*Malformed UUID.*$', 'setuuid', sbox.repo_dir, 'abcdef')
    svntest.actions.run_and_verify_svnadmin([], None, 'setuuid', sbox.repo_dir)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    new_uuid = output[0].rstrip()
    if (new_uuid == orig_uuid):
        logger.warn('Error: new UUID matches the original one')
        raise svntest.Failure
    svntest.actions.run_and_verify_svnadmin([], None, 'setuuid', sbox.repo_dir, orig_uuid)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    new_uuid = output[0].rstrip()
    if (new_uuid != orig_uuid):
        logger.warn("Error: new UUID doesn't match the original one")
        raise svntest.Failure
test 'svnadmin setuuid'
def set_uuid(sbox):
    
    sbox.build(create_wc=False)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    orig_uuid = output[0].rstrip()
    svntest.actions.run_and_verify_svnadmin(None, '^.*Malformed UUID.*$', 'setuuid', sbox.repo_dir, 'abcdef')
    svntest.actions.run_and_verify_svnadmin([], None, 'setuuid', sbox.repo_dir)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    new_uuid = output[0].rstrip()
    if (new_uuid == orig_uuid):
        logger.warn('Error: new UUID matches the original one')
        raise svntest.Failure
    svntest.actions.run_and_verify_svnadmin([], None, 'setuuid', sbox.repo_dir, orig_uuid)
    (exit_code, output, errput) = svntest.main.run_svnlook('uuid', sbox.repo_dir)
    if errput:
        raise SVNUnexpectedStderr(errput)
    new_uuid = output[0].rstrip()
    if (new_uuid != orig_uuid):
        logger.warn("Error: new UUID doesn't match the original one")
        raise svntest.Failure