diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/spdk/test/ocf/integrity/mallocs.conf | |
parent | Initial commit. (diff) | |
download | ceph-upstream/16.2.11+ds.tar.xz ceph-upstream/16.2.11+ds.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/test/ocf/integrity/mallocs.conf')
-rw-r--r-- | src/spdk/test/ocf/integrity/mallocs.conf | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/spdk/test/ocf/integrity/mallocs.conf b/src/spdk/test/ocf/integrity/mallocs.conf new file mode 100644 index 000000000..245dd23cf --- /dev/null +++ b/src/spdk/test/ocf/integrity/mallocs.conf @@ -0,0 +1,59 @@ +gen_malloc_ocf_json () { + local size=300 # MB + local block_size=512 + local config + + local malloc malloc_devs=3 + for (( malloc = 0; malloc < malloc_devs; malloc++ )); do + config+=( + "$( + cat <<-JSON + { + "method": "bdev_malloc_create", + "params": { + "name": "Malloc$malloc", + "num_blocks": $(( (size << 20) / block_size )), + "block_size": 512 + } + } + JSON + )" + ) + done + + local ocfs ocf ocf_mode ocf_cache ocf_core + ocfs=(1 2) + ocf_mode[1]=wt ocf_cache[1]=Malloc0 ocf_core[1]=Malloc1 + ocf_mode[2]=pt ocf_cache[2]=Malloc0 ocf_core[2]=Malloc2 + + for ocf in "${ocfs[@]}"; do + config+=( + "$( + cat <<-JSON + { + "method": "bdev_ocf_create", + "params": { + "name": "MalCache$ocf", + "mode": "${ocf_mode[ocf]}", + "cache_bdev_name": "${ocf_cache[ocf]}", + "core_bdev_name": "${ocf_core[ocf]}" + } + } + JSON + )" + ) + done + + jq . <<-JSON + { + "subsystems": [ + { + "subsystem": "bdev", + "config": [ + $(IFS=","; printf '%s\n' "${config[*]}") + ] + } + ] + } + JSON +} |