diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/cli/crushtool/output-csv.t | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/cli/crushtool/output-csv.t')
-rw-r--r-- | src/test/cli/crushtool/output-csv.t | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/test/cli/crushtool/output-csv.t b/src/test/cli/crushtool/output-csv.t new file mode 100644 index 000000000..0769dacd5 --- /dev/null +++ b/src/test/cli/crushtool/output-csv.t @@ -0,0 +1,51 @@ +# first test that CSV files are created for each rule +$ crushtool -i five-devices.crushmap --test --num-rep 1 --min-x 0 --max-x 9 --output-csv +$ if [ ! -f data-absolute_weights.csv ]; then echo FAIL; fi +$ if [ ! -f data-batch_device_expected_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f data-batch_device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f data-device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f data-device_utilization.csv ]; then echo FAIL; fi +$ if [ ! -f data-placement_information.csv ]; then echo FAIL; fi +$ if [ ! -f data-proportional_weights_all.csv ]; then echo FAIL; fi +$ if [ ! -f data-proportional_weights.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-absolute_weights.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-batch_device_expected_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-batch_device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-device_utilization.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-placement_information.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-proportional_weights_all.csv ]; then echo FAIL; fi +$ if [ ! -f metadata-proportional_weights.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-absolute_weights.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-batch_device_expected_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-batch_device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-device_utilization.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-placement_information.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-proportional_weights_all.csv ]; then echo FAIL; fi +$ if [ ! -f rbd-proportional_weights.csv ]; then echo FAIL; fi +$ rm data*csv +$ rm metadata*csv +$ rm rbd*csv +# now check that the CSV files are made to the proper length +$ crushtool -i five-devices.crushmap --test --rule 0 --num-rep 1 --min-x 0 --max-x 9 --output-csv +$ if [ $(wc -l data-absolute_weights.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-batch_device_expected_utilization_all.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-batch_device_utilization_all.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-device_utilization_all.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-device_utilization.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-placement_information.csv | awk '{print $1}') != "10" ]; then echo FAIL; fi +$ if [ $(wc -l data-proportional_weights_all.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ if [ $(wc -l data-proportional_weights.csv | awk '{print $1}') != "5" ]; then echo FAIL; fi +$ rm data*csv +# finally check that user supplied tags are prepended correctly +$ crushtool -i five-devices.crushmap --test --rule 0 --num-rep 1 --min-x 0 --max-x 9 --output-name "test-tag" --output-csv +$ if [ ! -f test-tag-data-absolute_weights.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-batch_device_expected_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-batch_device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-device_utilization_all.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-device_utilization.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-placement_information.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-proportional_weights_all.csv ]; then echo FAIL; fi +$ if [ ! -f test-tag-data-proportional_weights.csv ]; then echo FAIL; fi +$ rm test-tag*csv |