Skip to content

Commit 40c1c3f

Browse files
committed
smoke test for dpkg and yum for aws mount_cached mode
1 parent fae08f1 commit 40c1c3f

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

tests/smoke_tests/test_mount_and_storage.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,74 @@ def test_aws_storage_mounts_arm64():
309309
smoke_tests_utils.run_one_test(test)
310310

311311

312+
@pytest.mark.aws
313+
def test_aws_dpkg_storage_mounts_cached():
314+
name = smoke_tests_utils.get_cluster_name()
315+
cloud = 'aws'
316+
storage_name = f'sky-test-{int(time.time())}'
317+
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f1:
318+
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f2:
319+
test_commands, clean_command = _storage_mount_cached_test_command_generator(
320+
f1, f2, name, storage_name, cloud)
321+
322+
for i, cmd in enumerate(test_commands):
323+
if cmd.startswith('sky launch') and '--infra aws' in cmd:
324+
test_commands[i] = cmd.replace(
325+
'--infra aws',
326+
# The image ID is retrieved with:
327+
328+
# aws ec2 describe-images \
329+
# --owners 099720109477 \
330+
# --filters "Name=name,Values=ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" \
331+
# --query 'Images | sort_by(@, &CreationDate) | [-1].[ImageId,Name,CreationDate]' \
332+
# --output text --region us-east-2
333+
'--infra aws/us-east-2 --image-id ami-0f5fcdfbd140e4ab7'
334+
)
335+
break
336+
337+
test = smoke_tests_utils.Test(
338+
'aws_dpkg_storage_mount_cached',
339+
test_commands,
340+
clean_command,
341+
timeout=20 * 60, # 20 mins
342+
)
343+
smoke_tests_utils.run_one_test(test)
344+
345+
346+
@pytest.mark.aws
347+
def test_aws_yum_storage_mounts_cached():
348+
name = smoke_tests_utils.get_cluster_name()
349+
cloud = 'aws'
350+
storage_name = f'sky-test-{int(time.time())}'
351+
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f1:
352+
with tempfile.NamedTemporaryFile(suffix='.yaml', mode='w') as f2:
353+
test_commands, clean_command = _storage_mount_cached_test_command_generator(
354+
f1, f2, name, storage_name, cloud)
355+
356+
for i, cmd in enumerate(test_commands):
357+
if cmd.startswith('sky launch') and '--infra aws' in cmd:
358+
test_commands[i] = cmd.replace(
359+
'--infra aws',
360+
# The image ID is retrieved with:
361+
362+
# aws ec2 describe-images \
363+
# --owners amazon \
364+
# --filters "Name=name,Values=al2023-ami-2023.*-x86_64" \
365+
# --query 'Images | sort_by(@, &CreationDate) | [-1].[ImageId,Name]' \
366+
# --output text --region us-east-2
367+
'--infra aws/us-east-2 --image-id ami-0a5a5b7e2278263e5'
368+
)
369+
break
370+
371+
test = smoke_tests_utils.Test(
372+
'aws_yum_storage_mount_cached',
373+
test_commands,
374+
clean_command,
375+
timeout=20 * 60, # 20 mins
376+
)
377+
smoke_tests_utils.run_one_test(test)
378+
379+
312380
@pytest.mark.aws
313381
def test_aws_storage_mounts_with_stop():
314382
name = smoke_tests_utils.get_cluster_name()

0 commit comments

Comments
 (0)