Skip to content

Commit

Permalink
fix(nvmf/uri): use nvmf:// scheme for tcp
Browse files Browse the repository at this point in the history
Signed-off-by: Diwakar Sharma <[email protected]>
  • Loading branch information
dsharma-dc committed Dec 19, 2024
1 parent 17488f4 commit 1138e79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions io-engine/src/subsys/nvmf/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion io-engine/tests/nvmf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion test/grpc/test_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1138e79

Please sign in to comment.