예제 #1
0
def nsat_checksum_http_cmd(args):
    match = nsat.checksums_http(
        (args.host, args.port),
        path=args.path,
        timeout=args.timeout,
        verbose=not args.quiet,
    )
    for line in lines(args):
        expr = nsat.parse(line.strip())
        for ass in nsat.solve_checksum(expr, match, args.parallel):
            print ass
예제 #2
0
def nsat_checksum_cmd(args):
    match = nsat.checksums
    for line in lines(args):
        expr = nsat.parse(line.strip())
        for ass in nsat.solve_checksum(expr, match, args.parallel):
            print ass
예제 #3
0
def nsat_contraint_cmd(args):
    for line in lines(args):
        expr = nsat.parse(line.strip())
        for ass in nsat.solve_constraint(expr):
            print ass
예제 #4
0
def test_nsat_checksum_http(raw, host, ipt_rst_drop_rule):
    expr = nsat.parse(raw)
    expected = nsat_fixtures[raw]
    match = nsat.checksums_http(host)
    actual = normalize(nsat.solve_checksum(expr, match, parallel=True))
    assert expected == actual
예제 #5
0
def test_nsat_checksum(raw):
    expr = nsat.parse(raw)
    expected = nsat_fixtures[raw]
    actual = normalize(nsat.solve_checksum(expr, nsat.checksums))
    assert expected == actual
예제 #6
0
def test_nsat_constraint(raw, ipt_rst_drop_rule):
    expr = nsat.parse(raw)
    expected = nsat_fixtures[raw]
    actual = normalize(nsat.solve_constraint(expr))
    assert expected == actual