tests/dummyssh
author Adrian Buehlmann <adrian@cadifra.com>
Fri, 24 Jun 2011 10:31:44 +0200
branchstable
changeset 14729 94eea58da2a3
parent 14186 8513bd2e7259
child 15768 cdf9c43445df
permissions -rwxr-xr-x
update: do not use the term 'update' when mentioning reverting one file and give a more precise hint for how to revert such a file I'm using the term 'revision' instead of 'changeset' in this change to be consistent with the REV we use in the synopsis.

#!/usr/bin/env python

import sys
import os

os.chdir(os.getenv('TESTTMP'))

if sys.argv[1] != "user@dummy":
    sys.exit(-1)

os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"

log = open("dummylog", "ab")
log.write("Got arguments")
for i, arg in enumerate(sys.argv[1:]):
    log.write(" %d:%s" % (i+1, arg))
log.write("\n")
log.close()
r = os.system(sys.argv[2])
sys.exit(bool(r))