diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-05-02 04:45:28 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-05-02 04:45:28 +0000 |
commit | d7f5140b8b84eb9e27509a1c0fb6872a782b1fe8 (patch) | |
tree | de2e3799b32aa5588ba0183a53ecd18971bd9a10 /testing | |
parent | 891844a52a28d9c5be86bf055e02180cb2b63275 (diff) | |
download | sg3_utils-d7f5140b8b84eb9e27509a1c0fb6872a782b1fe8.tar.gz |
sg_rep_zones: add experimental --json[=JO] option and generation
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@950 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'testing')
-rw-r--r-- | testing/sg_tst_async.cpp | 18 | ||||
-rw-r--r-- | testing/sg_tst_context.cpp | 8 | ||||
-rw-r--r-- | testing/sg_tst_excl.cpp | 10 | ||||
-rw-r--r-- | testing/sg_tst_excl2.cpp | 8 | ||||
-rw-r--r-- | testing/sg_tst_excl3.cpp | 8 |
5 files changed, 26 insertions, 26 deletions
diff --git a/testing/sg_tst_async.cpp b/testing/sg_tst_async.cpp index acef7e04..f81a26dd 100644 --- a/testing/sg_tst_async.cpp +++ b/testing/sg_tst_async.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2021 Douglas Gilbert. + * Copyright (c) 2014-2022 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ #include "sg_pt.h" #include "sg_cmds.h" -static const char * version_str = "1.41 20210331"; +static const char * version_str = "1.42 20220425"; static const char * util_name = "sg_tst_async"; /* This is a test program for checking the async usage of the Linux sg @@ -467,7 +467,7 @@ start_sg3_cmd(int sg_fd, command2execute cmd2exe, int pack_id, uint64_t lba, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; uint8_t w16CmdBlk[WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - uint8_t sense_buffer[64]; + uint8_t sense_buffer[64] = {0}; const char * np = NULL; struct sg_io_hdr * ptp; @@ -552,7 +552,7 @@ finish_sg3_cmd(int sg_fd, command2execute cmd2exe, int & pack_id, { bool ok; int res, k; - uint8_t sense_buffer[64]; + uint8_t sense_buffer[64] = {0}; const char * np = NULL; struct sg_io_hdr pt; struct sg_io_hdr * ptp; @@ -652,7 +652,7 @@ start_sg4_cmd(int sg_fd, command2execute cmd2exe, int pack_id, uint64_t lba, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; uint8_t w16CmdBlk[WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - uint8_t sense_buffer[64]; + uint8_t sense_buffer[64] = {0}; const char * np = NULL; struct sg_io_v4 * ptp; @@ -730,7 +730,7 @@ finish_sg4_cmd(int sg_fd, command2execute cmd2exe, int & pack_id, { bool ok; int res, k; - uint8_t sense_buffer[64]; + uint8_t sense_buffer[64] = {0}; const char * np = NULL; struct sg_io_v4 * ptp; struct sg_io_v4 p4t; @@ -869,7 +869,7 @@ work_sync_thread(int id, const char * dev_name, unsigned int /* hi_lba */, int thr_sync_starts = 0; struct sg_pt_base * ptp = NULL; uint8_t cdb[6]; - uint8_t sense_b[32]; + uint8_t sense_b[32] = {0}; char b[120]; if (is_rw) { @@ -1610,7 +1610,7 @@ do_inquiry_prod_id(const char * dev_name, int block, int & sg_ver_num, uint8_t inqCmdBlk [INQ_CMD_LEN] = {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; uint8_t inqBuff[INQ_REPLY_LEN]; - uint8_t sense_buffer[64]; + uint8_t sense_buffer[64] = {0}; int open_flags = O_RDWR; /* O_EXCL | O_RDONLY fails with EPERM */ if (! block) @@ -1689,7 +1689,7 @@ do_read_capacity(const char * dev_name, int block, unsigned int * last_lba, int res, sg_fd; uint8_t rcCmdBlk [10] = {0x25, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint8_t rcBuff[64]; - uint8_t sense_b[64]; + uint8_t sense_b[64] = {0}; sg_io_hdr_t io_hdr; int open_flags = O_RDWR; /* O_EXCL | O_RDONLY fails with EPERM */ diff --git a/testing/sg_tst_context.cpp b/testing/sg_tst_context.cpp index 6f95717e..fd0f68b6 100644 --- a/testing/sg_tst_context.cpp +++ b/testing/sg_tst_context.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 Douglas Gilbert. + * Copyright (c) 2013-2022 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ #include "sg_lib.h" #include "sg_pt.h" -static const char * version_str = "1.05 20190917"; +static const char * version_str = "1.06 20220425"; static const char * util_name = "sg_tst_context"; /* This is a test program for checking that file handles keep their @@ -183,7 +183,7 @@ do_tur(struct sg_pt_base * ptp, int id) { int slen, res, cat; unsigned char turCmdBlk [TUR_CMD_LEN] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; clear_scsi_pt_obj(ptp); set_scsi_pt_cdb(ptp, turCmdBlk, sizeof(turCmdBlk)); @@ -228,7 +228,7 @@ do_ssu(struct sg_pt_base * ptp, int id, bool start) { int slen, res, cat; unsigned char ssuCmdBlk [SSU_CMD_LEN] = {0x1b, 0x0, 0x0, 0x0, 0x0, 0x0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; if (start) ssuCmdBlk[4] |= 0x1; diff --git a/testing/sg_tst_excl.cpp b/testing/sg_tst_excl.cpp index fba1d6a1..eeba5545 100644 --- a/testing/sg_tst_excl.cpp +++ b/testing/sg_tst_excl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2021 Douglas Gilbert. + * Copyright (c) 2013-2022 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,7 +73,7 @@ #include "sg_io_linux.h" #include "sg_unaligned.h" -static const char * version_str = "1.13 20210801"; +static const char * version_str = "1.14 20220425"; static const char * util_name = "sg_tst_excl"; /* This is a test program for checking O_EXCL on open() works. It uses @@ -192,7 +192,7 @@ do_rd_inc_wr_twice_v3(const char * dev_name, unsigned int lba, int block, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; unsigned char w16CmdBlk [WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; unsigned char lb[READ16_REPLY_LEN]; int open_flags = O_RDWR; @@ -437,7 +437,7 @@ do_rd_inc_wr_twice_v4(const char * dev_name, unsigned int lba, int block, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; unsigned char w16CmdBlk [WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; unsigned char lb[READ16_REPLY_LEN]; int open_flags = O_RDWR; @@ -696,7 +696,7 @@ do_inquiry_prod_id(const char * dev_name, int block, int wait_ms, unsigned char inqCmdBlk [INQ_CMD_LEN] = {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; unsigned char inqBuff[INQ_REPLY_LEN]; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; int open_flags = O_RDWR; /* O_EXCL | O_RDONLY fails with EPERM */ if (! block) diff --git a/testing/sg_tst_excl2.cpp b/testing/sg_tst_excl2.cpp index b4ae9582..f6bd617d 100644 --- a/testing/sg_tst_excl2.cpp +++ b/testing/sg_tst_excl2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 Douglas Gilbert. + * Copyright (c) 2013-2022 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ #include "sg_pt.h" #include "sg_unaligned.h" -static const char * version_str = "1.10 20190917"; +static const char * version_str = "1.11 20220425"; static const char * util_name = "sg_tst_excl2"; /* This is a test program for checking O_EXCL on open() works. It uses @@ -198,7 +198,7 @@ do_rd_inc_wr_twice(const char * dev_name, unsigned int lba, int block, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; unsigned char w16CmdBlk [WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; unsigned char lb[READ16_REPLY_LEN]; char ebuff[EBUFF_SZ]; int open_flags = O_RDWR; @@ -323,7 +323,7 @@ do_inquiry_prod_id(const char * dev_name, int block, int wait_ms, unsigned char inqCmdBlk [INQ_CMD_LEN] = {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; unsigned char inqBuff[INQ_REPLY_LEN]; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; char ebuff[EBUFF_SZ]; int open_flags = O_RDWR; /* since O_EXCL | O_RDONLY gives EPERM */ diff --git a/testing/sg_tst_excl3.cpp b/testing/sg_tst_excl3.cpp index f511dd66..685b33f6 100644 --- a/testing/sg_tst_excl3.cpp +++ b/testing/sg_tst_excl3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 Douglas Gilbert. + * Copyright (c) 2013-2022 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ #include "sg_pt.h" #include "sg_unaligned.h" -static const char * version_str = "1.10 20190917"; +static const char * version_str = "1.11 20220425"; static const char * util_name = "sg_tst_excl3"; /* This is a test program for checking O_EXCL on open() works. It uses @@ -204,7 +204,7 @@ do_rd_inc_wr_twice(const char * dev_name, int read_only, unsigned int lba, {0x88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; unsigned char w16CmdBlk [WRITE16_CMD_LEN] = {0x8a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; unsigned char lb[READ16_REPLY_LEN]; char ebuff[EBUFF_SZ]; int open_flags = O_RDWR; @@ -331,7 +331,7 @@ do_inquiry_prod_id(const char * dev_name, int block, int wait_ms, unsigned char inqCmdBlk [INQ_CMD_LEN] = {0x12, 0, 0, 0, INQ_REPLY_LEN, 0}; unsigned char inqBuff[INQ_REPLY_LEN]; - unsigned char sense_buffer[64]; + unsigned char sense_buffer[64] = {0}; char ebuff[EBUFF_SZ]; int open_flags = O_RDWR; /* since O_EXCL | O_RDONLY gives EPERM */ |