Skip to content

Commit d96cd61

Browse files
committed
Make madns xtest arguments configurable
1 parent 0094d7b commit d96cd61

24 files changed

+135
-129
lines changed

Justfile

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ export DOG_DEBUG := ""
7373
specsheet xtests/options/*.toml xtests/live/{basics,tcp}.toml -shide {{args}} \
7474
-O cmd.target.dog="${CARGO_TARGET_DIR:-../../target}/debug/dog"
7575

76+
# run extended tests against a local madns instance
77+
@xtests-madns-local *args:
78+
env MADNS_ARGS="@localhost:5301 --tcp" \
79+
specsheet xtests/madns/*.toml -shide {{args}} \
80+
-O cmd.target.dog="${CARGO_TARGET_DIR:-../../target}/debug/dog"
81+
7682
# display the number of extended tests that get run
7783
@count-xtests:
7884
grep -F '[[cmd]]' -R xtests | wc -l

xtests/madns/a-records.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘a.example’ prints the correct A record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A a.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A a.example"
66
stdout = { file = "outputs/a.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "a", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘a.example’ prints the correct A record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A a.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A a.example --json | jq"
1717
stdout = { file = "outputs/a.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,31 +24,31 @@ tags = [ "a", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘too-long.a.invalid’ displays a record length error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A too-long.a.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A too-long.a.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: record length should be 4, got 5" }
3030
status = 1
3131
tags = [ "a", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘too-short.a.invalid’ displays a record length error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A too-short.a.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A too-short.a.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: record length should be 4, got 3" }
3838
status = 1
3939
tags = [ "a", "madns" ]
4040

4141
[[cmd]]
4242
name = "Running with ‘empty.a.invalid’ displays a record length error"
43-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A empty.a.invalid"
43+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A empty.a.invalid"
4444
stdout = { empty = true }
4545
stderr = { string = "Error [protocol]: Malformed packet: record length should be 4, got 0" }
4646
status = 1
4747
tags = [ "a", "madns" ]
4848

4949
[[cmd]]
5050
name = "Running with ‘incomplete.a.invalid’ displays a protocol error"
51-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 A incomplete.a.invalid"
51+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} A incomplete.a.invalid"
5252
stdout = { empty = true }
5353
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
5454
status = 1

xtests/madns/aaaa-records.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘aaaa.example’ prints the correct AAAA record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA aaaa.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA aaaa.example"
66
stdout = { file = "outputs/aaaa.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "aaaa", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘aaaa.example’ prints the correct AAAA record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA aaaa.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA aaaa.example --json | jq"
1717
stdout = { file = "outputs/aaaa.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,31 +24,31 @@ tags = [ "aaaa", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘too-long.aaaa.invalid’ displays a record length error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA too-long.aaaa.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA too-long.aaaa.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: record length should be 16, got 17" }
3030
status = 1
3131
tags = [ "aaaa", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘too-short.aaaa.invalid’ displays a record length error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA too-short.aaaa.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA too-short.aaaa.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: record length should be 16, got 8" }
3838
status = 1
3939
tags = [ "aaaa", "madns" ]
4040

4141
[[cmd]]
4242
name = "Running with ‘empty.aaaa.invalid’ displays a record length error"
43-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA empty.aaaa.invalid"
43+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA empty.aaaa.invalid"
4444
stdout = { empty = true }
4545
stderr = { string = "Error [protocol]: Malformed packet: record length should be 16, got 0" }
4646
status = 1
4747
tags = [ "aaaa", "madns" ]
4848

4949
[[cmd]]
5050
name = "Running with ‘incomplete.aaaa.invalid’ displays a protocol error"
51-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 AAAA incomplete.aaaa.invalid"
51+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} AAAA incomplete.aaaa.invalid"
5252
stdout = { empty = true }
5353
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
5454
status = 1

xtests/madns/caa-records.toml

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
[[cmd]]
44
name = "Running with ‘caa.example’ prints the correct CAA record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA caa.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA caa.example"
66
stdout = { file = "outputs/caa.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
99
tags = [ "caa", "madns" ]
1010

1111
[[cmd]]
1212
name = "Running with ‘critical.caa.example’ prints the correct CAA record with the flag"
13-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA critical.caa.example"
13+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA critical.caa.example"
1414
stdout = { file = "outputs/critical.caa.example.ansitxt" }
1515
stderr = { empty = true }
1616
status = 0
1717
tags = [ "caa", "madns" ]
1818

1919
[[cmd]]
2020
name = "Running with ‘others.caa.example’ prints the correct CAA record and ignores the flags"
21-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA others.caa.example"
21+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA others.caa.example"
2222
stdout = { file = "outputs/others.caa.example.ansitxt" }
2323
stderr = { empty = true }
2424
status = 0
@@ -29,23 +29,23 @@ tags = [ "caa", "madns" ]
2929

3030
[[cmd]]
3131
name = "Running with ‘caa.example’ prints the correct CAA record structure"
32-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA caa.example --json | jq"
32+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA caa.example --json | jq"
3333
stdout = { file = "outputs/caa.example.json" }
3434
stderr = { empty = true }
3535
status = 0
3636
tags = [ "caa", "madns", "json" ]
3737

3838
[[cmd]]
3939
name = "Running with ‘critical.caa.example’ prints the correct CAA record structurewith the flag"
40-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA critical.caa.example --json | jq"
40+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA critical.caa.example --json | jq"
4141
stdout = { file = "outputs/critical.caa.example.json" }
4242
stderr = { empty = true }
4343
status = 0
4444
tags = [ "caa", "madns", "json" ]
4545

4646
[[cmd]]
4747
name = "Running with ‘others.caa.example’ prints the correct CAA record structure and ignores the flags"
48-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA others.caa.example --json | jq"
48+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA others.caa.example --json | jq"
4949
stdout = { file = "outputs/others.caa.example.json" }
5050
stderr = { empty = true }
5151
status = 0
@@ -56,15 +56,15 @@ tags = [ "caa", "madns", "json" ]
5656

5757
[[cmd]]
5858
name = "Running with ‘empty.caa.invalid’ displays a protocol error"
59-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA empty.caa.invalid"
59+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA empty.caa.invalid"
6060
stdout = { empty = true }
6161
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
6262
status = 1
6363
tags = [ "caa", "madns" ]
6464

6565
[[cmd]]
6666
name = "Running with ‘incomplete.caa.invalid’ displays a protocol error"
67-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CAA incomplete.caa.invalid"
67+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CAA incomplete.caa.invalid"
6868
stdout = { empty = true }
6969
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
7070
status = 1

xtests/madns/cname-records.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘cname.example’ prints the correct CNAME record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CNAME cname.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CNAME cname.example"
66
stdout = { file = "outputs/cname.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "cname", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘cname.example’ prints the correct CNAME record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CNAME cname.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CNAME cname.example --json | jq"
1717
stdout = { file = "outputs/cname.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,15 +24,15 @@ tags = [ "cname", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘empty.cname.invalid’ displays a protocol error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CNAME empty.cname.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CNAME empty.cname.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
3030
status = 1
3131
tags = [ "cname", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘incomplete.cname.invalid’ displays a protocol error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 CNAME incomplete.cname.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} CNAME incomplete.cname.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
3838
status = 1

xtests/madns/eui48-records.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘eui48.example’ prints the correct EUI48 record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 eui48.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 eui48.example"
66
stdout = { file = "outputs/eui48.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "eui48", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘eui48.example’ prints the correct EUI48 record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 eui48.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 eui48.example --json | jq"
1717
stdout = { file = "outputs/eui48.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,31 +24,31 @@ tags = [ "eui48", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘too-long.eui48.invalid’ displays a record length error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 too-long.eui48.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 too-long.eui48.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: record length should be 6, got 7" }
3030
status = 1
3131
tags = [ "eui48", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘too-short.eui48.invalid’ displays a record length error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 too-short.eui48.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 too-short.eui48.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: record length should be 6, got 5" }
3838
status = 1
3939
tags = [ "eui48", "madns" ]
4040

4141
[[cmd]]
4242
name = "Running with ‘empty.eui48.invalid’ displays a record length error"
43-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 empty.eui48.invalid"
43+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 empty.eui48.invalid"
4444
stdout = { empty = true }
4545
stderr = { string = "Error [protocol]: Malformed packet: record length should be 6, got 0" }
4646
status = 1
4747
tags = [ "eui48", "madns" ]
4848

4949
[[cmd]]
5050
name = "Running with ‘incomplete.eui48.invalid’ displays a protocol error"
51-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI48 incomplete.eui48.invalid"
51+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI48 incomplete.eui48.invalid"
5252
stdout = { empty = true }
5353
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
5454
status = 1

xtests/madns/eui64-records.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘eui64.example’ prints the correct EUI64 record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 eui64.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 eui64.example"
66
stdout = { file = "outputs/eui64.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "eui64", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘eui64.example’ prints the correct EUI64 record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 eui64.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 eui64.example --json | jq"
1717
stdout = { file = "outputs/eui64.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,31 +24,31 @@ tags = [ "eui64", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘too-long.eui64.invalid’ displays a record length error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 too-long.eui64.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 too-long.eui64.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: record length should be 8, got 9" }
3030
status = 1
3131
tags = [ "eui64", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘too-short.eui64.invalid’ displays a record length error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 too-short.eui64.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 too-short.eui64.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: record length should be 8, got 7" }
3838
status = 1
3939
tags = [ "eui64", "madns" ]
4040

4141
[[cmd]]
4242
name = "Running with ‘empty.eui64.invalid’ displays a record length error"
43-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 empty.eui64.invalid"
43+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 empty.eui64.invalid"
4444
stdout = { empty = true }
4545
stderr = { string = "Error [protocol]: Malformed packet: record length should be 8, got 0" }
4646
status = 1
4747
tags = [ "eui64", "madns" ]
4848

4949
[[cmd]]
5050
name = "Running with ‘incomplete.eui64.invalid’ displays a protocol error"
51-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 EUI64 incomplete.eui64.invalid"
51+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} EUI64 incomplete.eui64.invalid"
5252
stdout = { empty = true }
5353
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
5454
status = 1

xtests/madns/hinfo-records.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[[cmd]]
44
name = "Running with ‘hinfo.example’ prints the correct HINFO record"
5-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 HINFO hinfo.example"
5+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} HINFO hinfo.example"
66
stdout = { file = "outputs/hinfo.example.ansitxt" }
77
stderr = { empty = true }
88
status = 0
@@ -13,7 +13,7 @@ tags = [ "hinfo", "madns" ]
1313

1414
[[cmd]]
1515
name = "Running with ‘hinfo.example’ prints the correct HINFO record structure"
16-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 HINFO hinfo.example --json | jq"
16+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} HINFO hinfo.example --json | jq"
1717
stdout = { file = "outputs/hinfo.example.json" }
1818
stderr = { empty = true }
1919
status = 0
@@ -24,15 +24,15 @@ tags = [ "hinfo", "madns", "json" ]
2424

2525
[[cmd]]
2626
name = "Running with ‘empty.hinfo.invalid’ displays a protocol error"
27-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 HINFO empty.hinfo.invalid"
27+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} HINFO empty.hinfo.invalid"
2828
stdout = { empty = true }
2929
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
3030
status = 1
3131
tags = [ "hinfo", "madns" ]
3232

3333
[[cmd]]
3434
name = "Running with ‘incomplete.hinfo.invalid’ displays a protocol error"
35-
shell = "dog --colour=always --tcp @madns.binarystar.systems:5301 HINFO incomplete.hinfo.invalid"
35+
shell = "dog --colour=always ${MADNS_ARGS:-@madns.binarystar.systems:5301 --tcp} HINFO incomplete.hinfo.invalid"
3636
stdout = { empty = true }
3737
stderr = { string = "Error [protocol]: Malformed packet: insufficient data" }
3838
status = 1

0 commit comments

Comments
 (0)