def test_create_already_exists(): ret = main([TEST_CA_ROOT, '-d', TEST_CA_DIR, '-n', 'example.com', '-w']) assert ret == 1 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') assert os.path.isfile(certfile) # remove now os.remove(certfile)
def test_file_create_wildcard_host_cert_force_overwrite(ca): ret = main([ TEST_CA_ROOT, "-d", TEST_CA_DIR, "--hostname", "example.com", "-w", "-f" ]) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, "example.com.pem") verify_san(ca, certfile, "DNS:example.com, DNS:*.example.com")
def test_file_create_wildcard_host_cert_force_overwrite(ca): ret = main([ TEST_CA_ROOT, '-d', TEST_CA_DIR, '--hostname', 'example.com', '-w', '-f' ]) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') verify_san(ca, certfile, ['DNS:example.com', 'DNS:*.example.com'])
def test_file_create_already_exists(ca): ret = main([TEST_CA_ROOT, "-d", TEST_CA_DIR, "-n", "example.com", "-w"]) assert ret == 1 certfile = os.path.join(TEST_CA_DIR, "example.com.pem") # from previous run verify_san(ca, certfile, "DNS:example.com, DNS:*.example.com") # remove now os.remove(certfile)
def test_file_create_already_exists(ca): ret = main([TEST_CA_ROOT, '-d', TEST_CA_DIR, '-n', 'example.com', '-w']) assert ret == 1 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') # from previous run verify_san(ca, certfile, ['DNS:example.com', 'DNS:*.example.com']) # remove now os.remove(certfile)
def test_file_create_host_cert(ca): ret = main([TEST_CA_ROOT, "-d", TEST_CA_DIR, "-n", "example.com"]) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, "example.com.pem") verify_san(ca, certfile, "DNS:example.com")
def test_create_root(): ret = main([TEST_CA_ROOT, "-c", "Test Root Cert"]) assert ret == 0
def test_create_root_already_exists(): ret = main([TEST_CA_ROOT]) # not created, already exists assert ret == 1 # remove now os.remove(TEST_CA_ROOT)
def test_create_wildcard_host_cert_force_overwrite(): ret = main([TEST_CA_ROOT, '-d', TEST_CA_DIR, '--hostname', 'example.com', '-w', '-f']) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') assert os.path.isfile(certfile)
def test_create_host_cert(): ret = main([TEST_CA_ROOT, '-d', TEST_CA_DIR, '-n', 'example.com']) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') assert os.path.isfile(certfile)
def test_create_root(): ret = main([TEST_CA_ROOT, '-c', 'Test Root Cert']) assert ret == 0
def test_file_create_host_cert(ca): ret = main([TEST_CA_ROOT, '-d', TEST_CA_DIR, '-n', 'example.com']) assert ret == 0 certfile = os.path.join(TEST_CA_DIR, 'example.com.pem') verify_san(ca, certfile, ['DNS:example.com'])
def test_create_root_no_dir_already_exists(): ret = main([CA_ROOT_FILENAME, '-c', 'Test Root Cert']) assert ret == 1