'Tests the linux nanny transaction log.'

def testLinuxNannyLog(self):

    with tempfile.NamedTemporaryFile() as fd:
        nanny_controller = client_utils_linux.NannyController()
        nanny_controller.StartNanny(nanny_logfile=fd.name)
        grr_message = rdf_flows.GrrMessage(session_id='W:test')
        nanny_controller.WriteTransactionLog(grr_message)
        self.assertRDFValuesEqual(grr_message, nanny_controller.GetTransactionLog())
        nanny_controller.CleanTransactionLog()
        self.assertIsNone(nanny_controller.GetTransactionLog())
        nanny_controller.StopNanny()
