def GetSSHDConfig(): if SSHD_CFG: return SSHD_CFG # Load an sshd config parser = config_file_parsers.SshdConfigParser() test_data = os.path.join(config.CONFIG["Test.data_dir"], "VFSFixture/etc/ssh/sshd_config") with open(test_data, "rb") as f: SSHD_CFG.extend(parser.Parse(None, f, None)) return SSHD_CFG
def setUpClass(cls): super(SshdCheckTests, cls).setUpClass() cls.LoadCheck("sshd.yaml") cls.parser = config_file.SshdConfigParser()
def GetConfig(self): """Read in the test configuration file.""" parser = config_file.SshdConfigParser() results = list(parser.Parse(None, StringIO.StringIO(CFG), None)) self.assertEqual(1, len(results)) return results[0]