test_x509.py (salt-3002.1) | : | test_x509.py (salt-3002.2) | ||
---|---|---|---|---|
skipping to change at line 168 | skipping to change at line 168 | |||
) | ) | |||
key = "x509_|-test_crt_|-{}/pki/test.crt_|-certificate_managed".format( | key = "x509_|-test_crt_|-{}/pki/test.crt_|-certificate_managed".format( | |||
RUNTIME_VARS.TMP | RUNTIME_VARS.TMP | |||
) | ) | |||
assert key in ret | assert key in ret | |||
assert "changes" in ret[key] | assert "changes" in ret[key] | |||
assert "Certificate" in ret[key]["changes"] | assert "Certificate" in ret[key]["changes"] | |||
assert "New" in ret[key]["changes"]["Certificate"] | assert "New" in ret[key]["changes"]["Certificate"] | |||
@slowTest | @slowTest | |||
def test_proper_cert_comparison(self): | ||||
# In this SLS we define two certs which have identical content. | ||||
# The first one is expected to be created. | ||||
# The second one is expected to be recognized as already present. | ||||
ret = self.run_function( | ||||
"state.apply", | ||||
["x509.proper_cert_comparison"], | ||||
pillar={"tmp_dir": RUNTIME_VARS.TMP}, | ||||
) | ||||
# check the first generated cert | ||||
first_key = "x509_|-test_crt_|-{}/pki/test.crt_|-certificate_managed".fo | ||||
rmat( | ||||
RUNTIME_VARS.TMP | ||||
) | ||||
assert first_key in ret | ||||
assert "changes" in ret[first_key] | ||||
assert "Certificate" in ret[first_key]["changes"] | ||||
assert "New" in ret[first_key]["changes"]["Certificate"] | ||||
# check whether the second defined cert is considered to match the first | ||||
one | ||||
second_key = "x509_|-second_test_crt_|-{}/pki/test.crt_|-certificate_man | ||||
aged".format( | ||||
RUNTIME_VARS.TMP | ||||
) | ||||
assert second_key in ret | ||||
assert "changes" in ret[second_key] | ||||
assert ret[second_key]["changes"] == {} | ||||
@slowTest | ||||
def test_crl_managed(self): | def test_crl_managed(self): | |||
ret = self.run_function( | ret = self.run_function( | |||
"state.apply", ["x509.crl_managed"], pillar={"tmp_dir": RUNTIME_VARS .TMP} | "state.apply", ["x509.crl_managed"], pillar={"tmp_dir": RUNTIME_VARS .TMP} | |||
) | ) | |||
key = "x509_|-{}/pki/ca.crl_|-{}/pki/ca.crl_|-crl_managed".format( | key = "x509_|-{}/pki/ca.crl_|-{}/pki/ca.crl_|-crl_managed".format( | |||
RUNTIME_VARS.TMP, RUNTIME_VARS.TMP | RUNTIME_VARS.TMP, RUNTIME_VARS.TMP | |||
) | ) | |||
# hints for easier debugging | # hints for easier debugging | |||
# import json | # import json | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 29 lines changed or added |