Merge pull request #1104 from mmichal10/init-var

Initialize uninitialized variable
This commit is contained in:
Robert Baldyga 2022-03-21 08:34:06 +01:00 committed by GitHub
commit 30eff21e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -26,9 +26,9 @@ Open CAS uses Safe string library (safeclib) that is MIT licensed.
To download latest Open CAS Linux release run following commands: To download latest Open CAS Linux release run following commands:
``` ```
wget https://github.com/Open-CAS/open-cas-linux/releases/download/v21.6.1/open-cas-linux-21.06.1.0547.release.tar.gz wget https://github.com/Open-CAS/open-cas-linux/releases/download/v21.6.5/open-cas-linux-21.06.5.0555.release.tar.gz
tar -xf open-cas-linux-21.06.1.0547.release.tar.gz tar -xf open-cas-linux-21.06.5.0555.release.tar.gz
cd open-cas-linux-21.06.1.0547.release/ cd open-cas-linux-21.06.5.0555.release/
``` ```
Alternatively, if you want recent development (unstable) version, you can clone GitHub repository: Alternatively, if you want recent development (unstable) version, you can clone GitHub repository:
@ -101,9 +101,9 @@ Before running tests make sure you have a platform with at least 2 disks (one fo
1. Go to test directory `cd test/functional`. 1. Go to test directory `cd test/functional`.
1. Install dependencies with command `pip3 install -r test-framework/requirements.txt`. 1. Install dependencies with command `pip3 install -r test-framework/requirements.txt`.
1. Create DUT config. See example [here](test/functional/config/example_dut_config.yml). 1. Create DUT config. See example [here](test/functional/config/example_dut_config.yml).
a) Set disks params. You need at least two disks, of which at least one is an SSD drive. a) Set disks params. You need at least two disks, of which at least one is an SSD drive.
b) For remote execution uncomment and set the `ip`, `user` and `password` fields. b) For remote execution uncomment and set the `ip`, `user` and `password` fields.
c) For local execution just leave these fields commented. c) For local execution just leave these fields commented.
1. Run tests using command `pytest-3 --dut-config=<CONFIG>` where `<CONFIG>` is path to your config file, for example `pytest-3 --dut-config="config/dut_config.yml"`. 1. Run tests using command `pytest-3 --dut-config=<CONFIG>` where `<CONFIG>` is path to your config file, for example `pytest-3 --dut-config="config/dut_config.yml"`.

View File

@ -2751,7 +2751,7 @@ int list_caches(unsigned int list_format, bool by_id_path)
char status_buf[CACHE_STATE_LENGHT]; char status_buf[CACHE_STATE_LENGHT];
const char *tmp_status; const char *tmp_status;
char mode_string[12]; char mode_string[12];
char cache_ctrl_dev[MAX_STR_LEN]; char cache_ctrl_dev[MAX_STR_LEN] = "-";
float cache_flush_prog; float cache_flush_prog;
float core_flush_prog; float core_flush_prog;
@ -2778,13 +2778,10 @@ int list_caches(unsigned int list_format, bool by_id_path)
if (!curr_cache->standby_detached) { if (!curr_cache->standby_detached) {
snprintf(cache_ctrl_dev, sizeof(cache_ctrl_dev), snprintf(cache_ctrl_dev, sizeof(cache_ctrl_dev),
"/dev/cas-cache-%d", curr_cache->id); "/dev/cas-cache-%d", curr_cache->id);
} else {
strncpy(cache_ctrl_dev, "-", sizeof(cache_ctrl_dev));
} }
} else { } else {
snprintf(mode_string, sizeof(mode_string), "%s", snprintf(mode_string, sizeof(mode_string), "%s",
cache_mode_to_name(curr_cache->mode)); cache_mode_to_name(curr_cache->mode));
strncpy(cache_ctrl_dev, "-", sizeof(cache_ctrl_dev));
} }
} }