From 113a0a22aa3753deda0f7b2d8961de63387c29c9 Mon Sep 17 00:00:00 2001 From: Daniel Milroy Date: Mon, 16 Dec 2024 19:18:11 -0800 Subject: [PATCH] testsuite: add tests for writing agfilter status Problem: the testsuite doesn't have tests for the new find behavior Add tests. --- .../find-format/jgf.expected.agfilter.json | 41 +++++++++++++++++++ t/t1015-find-format.t | 7 ++++ 2 files changed, 48 insertions(+) create mode 100644 t/data/resource/expected/find-format/jgf.expected.agfilter.json diff --git a/t/data/resource/expected/find-format/jgf.expected.agfilter.json b/t/data/resource/expected/find-format/jgf.expected.agfilter.json new file mode 100644 index 000000000..b549f9d97 --- /dev/null +++ b/t/data/resource/expected/find-format/jgf.expected.agfilter.json @@ -0,0 +1,41 @@ +{ + "graph": { + "nodes": [ + { + "id": "1", + "metadata": { + "type": "node", + "basename": "cab", + "id": 1234, + "exclusive": true, + "paths": { + "containment": "/cluster0/cab1234" + }, + "agfilter": { + "core": "used:0, total:16" + } + } + }, + { + "id": "0", + "metadata": { + "type": "cluster", + "id": 0, + "exclusive": true, + "paths": { + "containment": "/cluster0" + }, + "agfilter": { + "core": "used:0, total:16" + } + } + } + ], + "edges": [ + { + "source": "0", + "target": "1" + } + ] + } +} diff --git a/t/t1015-find-format.t b/t/t1015-find-format.t index 5a74bde12..6c94e61a1 100755 --- a/t/t1015-find-format.t +++ b/t/t1015-find-format.t @@ -93,6 +93,13 @@ test_expect_success 'find/status: find status=up format=jgf works' ' test_cmp jgf.query.json jgf.json ' +test_expect_success 'find/agfilter: find agfilter=true format=jgf works' ' + flux ion-resource find --format=jgf agfilter=true \ + | tail -1 > jgf.agfilter.raw.json && + normalize_json < jgf.agfilter.raw.json > jgf.json && + test_cmp ${expected_basepath}/jgf.expected.agfilter.json jgf.json +' + test_expect_success 'find/status: removing fluxion modules' ' remove_qmanager && remove_resource