From 1138e79554370f20c40ec1792521ba6e9956e239 Mon Sep 17 00:00:00 2001 From: Diwakar Sharma Date: Thu, 19 Dec 2024 11:05:18 +0000 Subject: [PATCH] fix(nvmf/uri): use nvmf:// scheme for tcp Signed-off-by: Diwakar Sharma --- io-engine/src/subsys/nvmf/transport.rs | 6 +++--- io-engine/tests/nvmf.rs | 2 +- test/grpc/test_common.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io-engine/src/subsys/nvmf/transport.rs b/io-engine/src/subsys/nvmf/transport.rs index 3e7a1657e..554f744f9 100644 --- a/io-engine/src/subsys/nvmf/transport.rs +++ b/io-engine/src/subsys/nvmf/transport.rs @@ -145,13 +145,13 @@ impl Display for TransportId { // trstring for uri scheme to explicitly indicate the tcp support // also by default when there is rdma available. let trstring = match self.0.trstring.as_str() { - "RDMA" => "rdma+tcp".to_string(), - _else => _else.to_lowercase(), + "RDMA" => "+rdma+tcp".to_string(), + _else => "".to_string(), }; write!( f, - "nvmf+{}://{}:{}", + "nvmf{}://{}:{}", trstring, self.0.traddr.as_str(), self.0.trsvcid.as_str() diff --git a/io-engine/tests/nvmf.rs b/io-engine/tests/nvmf.rs index 68e3f327a..8df8d9355 100644 --- a/io-engine/tests/nvmf.rs +++ b/io-engine/tests/nvmf.rs @@ -189,7 +189,7 @@ async fn nvmf_set_target_interface() { .into_inner() .uri; - let re = Regex::new(r"^nvmf(\+rdma\+tcp|\+tcp)://([0-9.]+):[0-9]+/.*$").unwrap(); + let re = Regex::new(r"^nvmf(\+rdma\+tcp|\+tcp)?://([0-9.]+):[0-9]+/.*$").unwrap(); let cap = re.captures(&bdev_uri).unwrap(); let shared_ip = cap.get(2).unwrap().as_str(); diff --git a/test/grpc/test_common.js b/test/grpc/test_common.js index 4583d88e8..e401dda3d 100644 --- a/test/grpc/test_common.js +++ b/test/grpc/test_common.js @@ -21,7 +21,7 @@ const CSI_ID = 'test-node-id'; const LOCALHOST = '127.0.0.1'; const NVME_MODEL_ID = 'Mayastor NVMe controller'; const NVME_NQN_PREFIX = 'nqn.2019-05.io.openebs'; -const NVMF_URI = /^nvmf\+(tcp|rdma\+tcp):\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d{1,5}\/nqn.2019-05.io.openebs:/; +const NVMF_URI = /^nvmf(\+tcp|\+rdma\+tcp)?:\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d{1,5}\/nqn.2019-05.io.openebs:/; const testPort = process.env.TEST_PORT || GRPC_PORT; const myIp = getMyIp() || LOCALHOST;