Skip to content

Commit

Permalink
Merge pull request ceph#461 from gbregman/devel
Browse files Browse the repository at this point in the history
Image size should be 64 bits
  • Loading branch information
gbregman authored Feb 25, 2024
2 parents 6554a3f + bf0e8ca commit efee9ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions control/proto/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ message namespace_add_req {
optional string uuid = 6;
optional int32 anagrpid = 7;
optional bool create_image = 8;
optional uint32 size = 9;
optional uint64 size = 9;
optional bool force = 10;
}

message namespace_resize_req {
string subsystem_nqn = 1;
optional uint32 nsid = 2;
optional string uuid = 3;
uint32 new_size = 4;
uint64 new_size = 4;
}

message namespace_get_io_stats_req {
Expand Down
16 changes: 13 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

image = "mytestdevimage"
image2 = "mytestdevimage2"
image3 = "mytestdevimage3"
pool = "rbd"
subsystem = "nqn.2016-06.io.spdk:cnode1"
subsystem2 = "nqn.2016-06.io.spdk:cnode2"
Expand Down Expand Up @@ -300,11 +301,17 @@ def test_add_namespace(self, caplog, gateway):
caplog.clear()
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", nsid])
assert '"load_balancing_group": 0' in caplog.text
caplog.clear()
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image3, "--size", "4GiB", "--rbd-create-image"])
assert f"Adding namespace 3 to {subsystem}, load balancing group 1: Successful" in caplog.text
caplog.clear()
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "3"])
assert '"rbd_image_size": "4294967296"' in caplog.text

def test_add_namespace_ipv6(self, caplog, gateway):
caplog.clear()
cli(["--server-address", server_addr_ipv6, "namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image, "--force"])
assert f"Adding namespace 3 to {subsystem}, load balancing group 1: Successful" in caplog.text
assert f"Adding namespace 4 to {subsystem}, load balancing group 1: Successful" in caplog.text
assert f'will continue as the "force" argument was used' in caplog.text
caplog.clear()
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "3"])
Expand All @@ -319,7 +326,7 @@ def test_add_namespace_same_image(self, caplog, gateway):
caplog.clear()
img_name = f"{image}_test"
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--size", "16MiB", "--rbd-create-image"])
assert f"Adding namespace 4 to {subsystem}, load balancing group 1: Successful" in caplog.text
assert f"Adding namespace 5 to {subsystem}, load balancing group 1: Successful" in caplog.text
caplog.clear()
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--size", "16MiB", "--rbd-create-image"])
assert f"RBD image {pool}/{img_name} is already used by a namespace" in caplog.text
Expand All @@ -330,7 +337,7 @@ def test_add_namespace_same_image(self, caplog, gateway):
assert f"you can find the offending namespace by using" in caplog.text
caplog.clear()
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--force"])
assert f"Adding namespace 5 to {subsystem}, load balancing group 1: Successful" in caplog.text
assert f"Adding namespace 6 to {subsystem}, load balancing group 1: Successful" in caplog.text
assert f"RBD image {pool}/{img_name} is already used by a namespace" in caplog.text
assert f'will continue as the "force" argument was used' in caplog.text

Expand Down Expand Up @@ -415,6 +422,9 @@ def test_resize_namespace(self, caplog, gateway):
caplog.clear()
cli(["namespace", "add", "--subsystem", subsystem, "--nsid", nsid, "--rbd-pool", pool, "--rbd-image", image, "--uuid", uuid, "--force"])
assert f"Adding namespace 1 to {subsystem}, load balancing group 1: Successful" in caplog.text
caplog.clear()
cli(["namespace", "resize", "--subsystem", subsystem, "--nsid", "3", "--size", "6GiB"])
assert f"Resizing namespace 3 in {subsystem} to 6144 MiB: Successful" in caplog.text

def test_set_namespace_qos_limits(self, caplog, gateway):
caplog.clear()
Expand Down

0 comments on commit efee9ee

Please sign in to comment.