def testPamExternalConfigs(self):
    pam_good = {"/etc/pam.d/ssh": "auth include other",
                "/etc/pam.d/other": ""}
    pam_bad = {"/etc/pam.d/ssh": "auth include non-existant",
               "/etc/pam.d/other": "password include /tmp/non-existant"}
    # Check the detection case.
    sym = "Found: PAM configuration refers to files outside of /etc/pam.d."
    found = ["/etc/pam.d/ssh -> /etc/pam.d/non-existant",
             "/etc/pam.d/other -> /tmp/non-existant"]
    results = self.RunChecks(self.GenFileData("PamConfig", pam_bad,
                                              parser=self.parser))
    self.assertCheckDetectedAnom("PAM-EXTERNAL-CONFIG", results,
                                 sym, found)
    # Now the pass cases.
    results = self.RunChecks(self.GenFileData("PamConfig", pam_good,
                                              parser=self.parser))
    self.assertCheckUndetected("PAM-SECURE-DEFAULTS", results)
Constructor
dataset/ETHPy150Open google/grr/grr/checks/pam_test.py/PamConfigTests.testPamExternalConfigs--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/form/fields.py/DateTimeField.__init__