# AAAA record successes

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


# AAAA record successes (JSON)

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


# AAAA record invalid packets

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

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

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

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