Example #1
0
def testReceivingServerAction():
    c = \
"""
[general]
fdtSendingClientCommand = sudo -u %(sudouser)s bash wrapper_fdt.sh -P 35 -p %(port)s -c %(hostDest)s -d / -fl %(fileList)s -noupdates
fdtReceivingServerCommand = sudo -u %(sudouser)s bash wrapper_fdt.sh -bs 2M -p %(port)s -noupdates
"""
    f = getTempFile(c)
    inputOption = "--config=%s" % f.name
    conf = ConfigFDTD(inputOption.split())
    a = ReceivingServerAction("some_id", dict(port = 1000, gridUserDest = "someuser"))    
    a._setUp(conf, 1000)
    assert a.options["port"] == 1000
    # this one did not get interpolated for server action, so it's not set
    py.test.raises(KeyError, a.options.__getitem__, "fdtSendingClientCommand")
    assert a.command == "sudo -u someuser bash wrapper_fdt.sh -bs 2M -p 1000 -noupdates"
Example #2
0
def testReceivingServerAction():
    c = \
        """
[general]
fdtSendingClientCommand = sudo -u %(sudouser)s bash wrapper_fdt.sh -P 35 -p %(port)s -c %(hostDest)s -d / -fl %(fileList)s -noupdates
fdtReceivingServerCommand = sudo -u %(sudouser)s bash wrapper_fdt.sh -bs 2M -p %(port)s -noupdates
"""
    f = getTempFile(c)
    inputOption = "--config=%s" % f.name
    conf = ConfigFDTD(inputOption.split())
    a = ReceivingServerAction("some_id",
                              dict(port=1000, gridUserDest="someuser"))
    a._setUp(conf, 1000)
    assert a.options["port"] == 1000
    # this one did not get interpolated for server action, so it's not set
    py.test.raises(KeyError, a.options.__getitem__, "fdtSendingClientCommand")
    cmd = "sudo -u someuser bash wrapper_fdt.sh -bs 2M -p 1000 -noupdates"
    assert a.command == cmd