Hi Pablo,
On 8/31/22 17:02, Pablo Neira Ayuso wrote:
Hi Fernando,
On Wed, Aug 31, 2022 at 02:37:31PM +0200, Fernando Fernandez Mancera wrote:
When listing a set with statements with JSON support, the statements were
ignored.
Output example:
{
"set": {
"op": "add",
"elem": {
"payload": {
"protocol": "ip",
"field": "saddr"
}
},
"stmt": [
{
"limit": {
"rate": 10,
"burst": 5,
"per": "second"
}
},
{
"counter": {
"packets": 0,
"bytes": 0
}
}
],
"set": "@my_ssh_meter"
}
}
LGTM, thanks.
Would you also extend tests/shell? There is a
tests/shell/testcases/json/ folder where you can add one.
One example test can be found here: tests/shell/testcases/json/netdev
If you also create this folder:
tests/shell/testcases/json/dump/mytest.dump
where 'mytest' is the name of you script under tests/shell/testcases/json/
Then, it also checks for the expected output via 'nft list ruleset'.
Sure, let me extend the tests too. I will send a v2 patch.
Thanks,
Fernando.