Skip to content

Commit 2d9e671

Browse files
author
Suyash Choudhary
committed
Add tests for 2025-12-01 API and remove stale recordings
- Added test_storage_mover_connection_scenarios for new connection resource CRUD - Added test_storage_mover_endpoint_s3_with_hmac_scenarios for S3WithHmac endpoint - Added test_storage_mover_job_definition_schedule_scenarios for schedule, preserve-permissions, data-integrity-validation - Removed 7 stale test recordings from 2025-07-01 API version
1 parent c522329 commit 2d9e671

18 files changed

Lines changed: 3112 additions & 12072 deletions

src/storage-mover/azext_storage_mover/_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ def load_arguments(self, _): # pylint: disable=unused-argument
2323
help='The name of the Storage Mover resource.')
2424
c.argument('description', help='A description for the Endpoint.')
2525

26+
for command in ['create-for-storage-container', 'create-for-nfs', 'create-for-storage-smb-file-share',
27+
'create-for-storage-nfs-file-share', 'create-for-multi-cloud-connector',
28+
'create-for-smb', 'create-for-s3-with-hmac']:
29+
with self.argument_context('storage-mover endpoint ' + command) as c:
30+
c.argument('endpoint_kind', arg_type=get_enum_type(['Source', 'Target']),
31+
help='The Endpoint resource kind, source or target.')
32+
2633
with self.argument_context('storage-mover endpoint create-for-storage-container') as c:
2734
c.argument('blob_container_name', options_list=('--container-name'),
2835
help='The name of the Storage blob container that is the target destination.')

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/endpoint/_update.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ def _update_instance(self, instance):
352352
credentials = _builder.get(".properties{endpointType:SmbMount}.credentials")
353353
if credentials is not None:
354354
credentials.set_prop("passwordUri", AAZStrType, ".password_uri")
355+
credentials.set_const("type", "AzureKeyVaultSmb", AAZStrType, ".", typ_kwargs={"flags": {"required": True}})
355356
credentials.set_prop("usernameUri", AAZStrType, ".username_uri")
356357

357358
return _instance_value

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/job_definition/_create.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
198198
minimum=0,
199199
),
200200
)
201-
execution_time.minute = AAZFloatArg(
201+
execution_time.minute = AAZIntArg(
202202
options=["minute"],
203203
help="The minute element of the time. Allowed values are 0 and 30. If not specified, its value defaults to 0.",
204204
default=0.0,
@@ -347,7 +347,7 @@ def content(self):
347347
execution_time = _builder.get(".properties.schedule.executionTime")
348348
if execution_time is not None:
349349
execution_time.set_prop("hour", AAZIntType, ".hour", typ_kwargs={"flags": {"required": True}})
350-
execution_time.set_prop("minute", AAZFloatType, ".minute")
350+
execution_time.set_prop("minute", AAZIntType, ".minute")
351351

352352
return self.serialize_content(_content_value)
353353

@@ -492,7 +492,7 @@ def _build_schema_on_200(cls):
492492
execution_time.hour = AAZIntType(
493493
flags={"required": True},
494494
)
495-
execution_time.minute = AAZFloatType()
495+
execution_time.minute = AAZIntType()
496496

497497
source_target_map = cls._schema_on_200.properties.source_target_map
498498
source_target_map.value = AAZListType(

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/job_definition/_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def _build_schema_on_200(cls):
297297
execution_time.hour = AAZIntType(
298298
flags={"required": True},
299299
)
300-
execution_time.minute = AAZFloatType()
300+
execution_time.minute = AAZIntType()
301301

302302
source_target_map = cls._schema_on_200.value.Element.properties.source_target_map
303303
source_target_map.value = AAZListType(

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/job_definition/_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def _build_schema_on_200(cls):
296296
execution_time.hour = AAZIntType(
297297
flags={"required": True},
298298
)
299-
execution_time.minute = AAZFloatType()
299+
execution_time.minute = AAZIntType()
300300

301301
source_target_map = cls._schema_on_200.properties.source_target_map
302302
source_target_map.value = AAZListType(

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/job_definition/_update.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
193193
minimum=0,
194194
),
195195
)
196-
execution_time.minute = AAZFloatArg(
196+
execution_time.minute = AAZIntArg(
197197
options=["minute"],
198198
help="The minute element of the time. Allowed values are 0 and 30. If not specified, its value defaults to 0.",
199199
nullable=True,
@@ -475,7 +475,7 @@ def _update_instance(self, instance):
475475
execution_time = _builder.get(".properties.schedule.executionTime")
476476
if execution_time is not None:
477477
execution_time.set_prop("hour", AAZIntType, ".hour", typ_kwargs={"flags": {"required": True}})
478-
execution_time.set_prop("minute", AAZFloatType, ".minute")
478+
execution_time.set_prop("minute", AAZIntType, ".minute")
479479

480480
return _instance_value
481481

@@ -629,7 +629,7 @@ def _build_schema_job_definition_read(cls, _schema):
629629
execution_time.hour = AAZIntType(
630630
flags={"required": True},
631631
)
632-
execution_time.minute = AAZFloatType()
632+
execution_time.minute = AAZIntType()
633633

634634
source_target_map = _schema_job_definition_read.properties.source_target_map
635635
source_target_map.value = AAZListType(

src/storage-mover/azext_storage_mover/aaz/latest/storage_mover/job_definition/_wait.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def _build_schema_on_200(cls):
295295
execution_time.hour = AAZIntType(
296296
flags={"required": True},
297297
)
298-
execution_time.minute = AAZFloatType()
298+
execution_time.minute = AAZIntType()
299299

300300
source_target_map = cls._schema_on_200.properties.source_target_map
301301
source_target_map.value = AAZListType(

src/storage-mover/azext_storage_mover/custom.py

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
def _get_args_for_endpoint_for_storage_container(endpoint_name, resource_group, storage_mover_name,
1818
blob_container_name=None, storage_account_resource_id=None,
19-
description=None):
19+
endpoint_kind=None, description=None):
2020
args = {
2121
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
2222
"description": description,
23-
"storage_blob_container": {
23+
"endpoint_kind": endpoint_kind,
24+
"azure_storage_blob_container": {
2425
"blob_container_name": blob_container_name,
2526
"storage_account_resource_id": storage_account_resource_id,
2627
}
@@ -29,10 +30,11 @@ def _get_args_for_endpoint_for_storage_container(endpoint_name, resource_group,
2930

3031

3132
def endpoint_create_for_storage_container(cmd, endpoint_name, resource_group, storage_mover_name, blob_container_name,
32-
storage_account_resource_id, description=None):
33+
storage_account_resource_id, endpoint_kind=None, description=None):
3334
Create_Endpoint = Create(cmd.loader)
3435
args = _get_args_for_endpoint_for_storage_container(endpoint_name, resource_group, storage_mover_name,
35-
blob_container_name, storage_account_resource_id, description)
36+
blob_container_name, storage_account_resource_id,
37+
endpoint_kind, description)
3638
args["mi_system_assigned"] = "True"
3739
return Create_Endpoint(args)
3840

@@ -46,10 +48,11 @@ def endpoint_update_for_storage_container(cmd, endpoint_name, resource_group, st
4648

4749
def _get_args_for_endpoint_for_storage_smb_file_share(endpoint_name, resource_group, storage_mover_name,
4850
file_share_name=None, storage_account_resource_id=None,
49-
description=None):
51+
endpoint_kind=None, description=None):
5052
args = {
5153
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
5254
"description": description,
55+
"endpoint_kind": endpoint_kind,
5356
"azure_storage_smb_file_share": {
5457
"file_share_name": file_share_name,
5558
"storage_account_resource_id": storage_account_resource_id,
@@ -59,10 +62,12 @@ def _get_args_for_endpoint_for_storage_smb_file_share(endpoint_name, resource_gr
5962

6063

6164
def endpoint_create_for_storage_smb_file_share(cmd, endpoint_name, resource_group, storage_mover_name,
62-
file_share_name, storage_account_resource_id, description=None):
65+
file_share_name, storage_account_resource_id,
66+
endpoint_kind=None, description=None):
6367
Create_Endpoint = Create(cmd.loader)
6468
args = _get_args_for_endpoint_for_storage_smb_file_share(endpoint_name, resource_group, storage_mover_name,
65-
file_share_name, storage_account_resource_id, description)
69+
file_share_name, storage_account_resource_id,
70+
endpoint_kind, description)
6671
return Create_Endpoint(args)
6772

6873

@@ -76,10 +81,11 @@ def endpoint_update_for_storage_smb_file_share(cmd, endpoint_name, resource_grou
7681

7782
def _get_args_for_endpoint_for_storage_nfs_file_share(endpoint_name, resource_group, storage_mover_name,
7883
file_share_name=None, storage_account_resource_id=None,
79-
description=None):
84+
endpoint_kind=None, description=None):
8085
args = {
8186
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
8287
"description": description,
88+
"endpoint_kind": endpoint_kind,
8389
"azure_storage_nfs_file_share": {
8490
"file_share_name": file_share_name,
8591
"storage_account_resource_id": storage_account_resource_id,
@@ -89,10 +95,12 @@ def _get_args_for_endpoint_for_storage_nfs_file_share(endpoint_name, resource_gr
8995

9096

9197
def endpoint_create_for_storage_nfs_file_share(cmd, endpoint_name, resource_group, storage_mover_name,
92-
file_share_name, storage_account_resource_id, description=None):
98+
file_share_name, storage_account_resource_id,
99+
endpoint_kind=None, description=None):
93100
Create_Endpoint = Create(cmd.loader)
94101
args = _get_args_for_endpoint_for_storage_nfs_file_share(endpoint_name, resource_group, storage_mover_name,
95-
file_share_name, storage_account_resource_id, description)
102+
file_share_name, storage_account_resource_id,
103+
endpoint_kind, description)
96104
return Create_Endpoint(args)
97105

98106

@@ -106,10 +114,11 @@ def endpoint_update_for_storage_nfs_file_share(cmd, endpoint_name, resource_grou
106114

107115
def _get_args_for_endpoint_for_multi_cloud_connector(endpoint_name, resource_group, storage_mover_name,
108116
multi_cloud_connector_id=None, aws_s3_bucket_id=None,
109-
description=None):
117+
endpoint_kind=None, description=None):
110118
args = {
111119
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
112120
"description": description,
121+
"endpoint_kind": endpoint_kind,
113122
"azure_multi_cloud_connector": {
114123
"multi_cloud_connector_id": multi_cloud_connector_id,
115124
"aws_s3_bucket_id": aws_s3_bucket_id,
@@ -119,10 +128,12 @@ def _get_args_for_endpoint_for_multi_cloud_connector(endpoint_name, resource_gro
119128

120129

121130
def endpoint_create_for_multi_cloud_connector(cmd, endpoint_name, resource_group, storage_mover_name,
122-
multi_cloud_connector_id, aws_s3_bucket_id, description=None):
131+
multi_cloud_connector_id, aws_s3_bucket_id,
132+
endpoint_kind=None, description=None):
123133
Create_Endpoint = Create(cmd.loader)
124134
args = _get_args_for_endpoint_for_multi_cloud_connector(endpoint_name, resource_group, storage_mover_name,
125-
multi_cloud_connector_id, aws_s3_bucket_id, description)
135+
multi_cloud_connector_id, aws_s3_bucket_id,
136+
endpoint_kind, description)
126137
return Create_Endpoint(args)
127138

128139

@@ -135,10 +146,12 @@ def endpoint_update_for_multi_cloud_connector(cmd, endpoint_name, resource_group
135146

136147

137148
def _get_args_for_endpoint_for_nfs(endpoint_name, resource_group, storage_mover_name,
138-
export=None, host=None, nfs_version=None, description=None):
149+
export=None, host=None, nfs_version=None,
150+
endpoint_kind=None, description=None):
139151
args = {
140152
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
141153
"description": description,
154+
"endpoint_kind": endpoint_kind,
142155
"nfs_mount": {
143156
"export": export,
144157
"host": host,
@@ -149,10 +162,10 @@ def _get_args_for_endpoint_for_nfs(endpoint_name, resource_group, storage_mover_
149162

150163

151164
def endpoint_create_for_nfs(cmd, endpoint_name, resource_group, storage_mover_name,
152-
export, host, nfs_version=None, description=None):
165+
export, host, nfs_version=None, endpoint_kind=None, description=None):
153166
Create_Endpoint = Create(cmd.loader)
154167
args = _get_args_for_endpoint_for_nfs(endpoint_name, resource_group, storage_mover_name,
155-
export, host, nfs_version, description)
168+
export, host, nfs_version, endpoint_kind, description)
156169
return Create_Endpoint(args)
157170

158171

@@ -163,10 +176,12 @@ def endpoint_update_for_nfs(cmd, endpoint_name, resource_group, storage_mover_na
163176

164177

165178
def _get_args_for_endpoint_for_smb(endpoint_name, resource_group, storage_mover_name,
166-
host=None, share_name=None, username_uri=None, password_uri=None, description=None):
179+
host=None, share_name=None, username_uri=None, password_uri=None,
180+
endpoint_kind=None, description=None):
167181
args = {
168182
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
169183
"description": description,
184+
"endpoint_kind": endpoint_kind,
170185
"smb_mount": {
171186
"host": host,
172187
"share_name": share_name
@@ -176,16 +191,17 @@ def _get_args_for_endpoint_for_smb(endpoint_name, resource_group, storage_mover_
176191
args["smb_mount"]["credentials"] = {
177192
"username_uri": username_uri,
178193
"password_uri": password_uri,
179-
"type": "AzureKeyVaultSmb"
180194
}
181195
return args
182196

183197

184198
def endpoint_create_for_smb(cmd, endpoint_name, resource_group, storage_mover_name,
185-
host, share_name, username_uri=None, password_uri=None, description=None):
199+
host, share_name, username_uri=None, password_uri=None,
200+
endpoint_kind=None, description=None):
186201
Create_Endpoint = Create(cmd.loader)
187202
args = _get_args_for_endpoint_for_smb(endpoint_name, resource_group, storage_mover_name,
188-
host, share_name, username_uri, password_uri, description)
203+
host, share_name, username_uri, password_uri,
204+
endpoint_kind, description)
189205
return Create_Endpoint(args)
190206

191207

@@ -201,10 +217,11 @@ def _get_args_for_endpoint_for_s3_with_hmac(endpoint_name, resource_group, stora
201217
source_uri=None, source_type=None,
202218
access_key_uri=None, secret_key_uri=None,
203219
other_source_type_description=None,
204-
description=None):
220+
endpoint_kind=None, description=None):
205221
args = {
206222
"endpoint_name": endpoint_name, "resource_group": resource_group, "storage_mover_name": storage_mover_name,
207223
"description": description,
224+
"endpoint_kind": endpoint_kind,
208225
"s3_with_hmac": {
209226
"source_uri": source_uri,
210227
"source_type": source_type,
@@ -221,12 +238,12 @@ def _get_args_for_endpoint_for_s3_with_hmac(endpoint_name, resource_group, stora
221238

222239
def endpoint_create_for_s3_with_hmac(cmd, endpoint_name, resource_group, storage_mover_name,
223240
source_uri, source_type, access_key_uri, secret_key_uri,
224-
other_source_type_description=None, description=None):
241+
endpoint_kind=None, other_source_type_description=None, description=None):
225242
Create_Endpoint = Create(cmd.loader)
226243
args = _get_args_for_endpoint_for_s3_with_hmac(
227244
endpoint_name, resource_group, storage_mover_name,
228245
source_uri, source_type, access_key_uri, secret_key_uri,
229-
other_source_type_description, description)
246+
other_source_type_description, endpoint_kind, description)
230247
return Create_Endpoint(args)
231248

232249

0 commit comments

Comments
 (0)