resolvectl: add JSON output support for "resolvectl query"
It's easy to add. Let's do so. This only covers record lookups, i.e. with the --type= switch. The higher level lookups are not covered, I opted instead to print a message there to use --type= instead. I am a bit reluctant to defining a new JSON format for the high-level lookups, hence I figured for now a helpful error is good enough, that points people to the right use. Fixes: #29755
This commit is contained in:
@@ -821,6 +821,9 @@ run resolvectl reset-statistics --json=pretty
|
||||
|
||||
run resolvectl reset-statistics --json=short
|
||||
|
||||
test "$(resolvectl --json=short query -t AAAA localhost)" == '{"key":{"class":1,"type":28,"name":"localhost"},"address":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]}'
|
||||
test "$(resolvectl --json=short query -t A localhost)" == '{"key":{"class":1,"type":1,"name":"localhost"},"address":[127,0,0,1]}'
|
||||
|
||||
# Check if resolved exits cleanly.
|
||||
restart_resolved
|
||||
|
||||
|
||||
Reference in New Issue
Block a user