[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87imice4uo.fsf@mellanox.com>
Date: Mon, 06 Apr 2020 22:28:31 +0200
From: Petr Machata <petrm@...lanox.com>
To: Jacob Keller <jacob.e.keller@...el.com>
Cc: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org,
dsahern@...il.com, stephen@...workplumber.org, davem@...emloft.net,
kuba@...nel.org, mlxsw@...lanox.com
Subject: Re: [patch iproute2/net-next] devlink: fix JSON output of mon command
Jacob Keller <jacob.e.keller@...el.com> writes:
> On 4/2/2020 2:56 AM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@...lanox.com>
>>
>> The current JSON output of mon command is broken. Fix it and make sure
>> that the output is a valid JSON. Also, handle SIGINT gracefully to allow
>> to end the JSON properly.
>>
>
> I wonder if there is an easy way we could get "make check" or something
> to add a test to help verify this is valid JSON?
Simply piping to jq is an easy way to figure out if it's at least valid
JSON. In principle it would be possible to write more detailed checks as
TDC (tc-testing) selftests in the kernel.
Something like this:
{
"id": "a520",
"name": "JSON",
"category": [
"qdisc",
"fifo"
],
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root bfifo"
],
"cmdUnderTest": "/bin/true",
"expExitCode": "0",
"verifyCmd": "$TC -j qdisc show dev $DUMMY | jq '.[].kind'",
"matchPattern": "bfifo",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root bfifo",
"$IP link del dev $DUMMY type dummy"
]
}
Kinda verbose for this level of detail though.
Powered by blists - more mailing lists