Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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