예제 #1
0
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)
예제 #2
0
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")
예제 #3
0
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'])
예제 #4
0
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)
예제 #5
0
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)
예제 #6
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")
예제 #7
0
def test_create_root():
    ret = main([TEST_CA_ROOT, "-c", "Test Root Cert"])
    assert ret == 0
예제 #8
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)
예제 #9
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)
예제 #10
0
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)
예제 #11
0
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)
예제 #12
0
def test_create_root():
    ret = main([TEST_CA_ROOT, '-c', 'Test Root Cert'])
    assert ret == 0
예제 #13
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'])
예제 #14
0
def test_create_root():
    ret = main([TEST_CA_ROOT, '-c', 'Test Root Cert'])
    assert ret == 0
예제 #15
0
def test_create_root_no_dir_already_exists():
    ret = main([CA_ROOT_FILENAME, '-c', 'Test Root Cert'])
    assert ret == 1