Skip to content

Commit e488533

Browse files
committed
test: add full integration test for bp files/dirs
This commit adds a full integration test for the files/dir blueprint customizations.
1 parent 21a39d1 commit e488533

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/test_build.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ def build_images(shared_tmpdir, build_container, request, force_aws_upload, gpg_
358358
"kernel": {
359359
"append": kargs,
360360
},
361+
"files": [
362+
{
363+
"path": "/etc/some-file",
364+
"data": "some-data",
365+
},
366+
],
367+
"directories": [
368+
{
369+
"path": "/etc/some-dir",
370+
},
371+
],
361372
},
362373
}
363374
testutil.maybe_create_filesystem_customizations(cfg, tc)
@@ -529,6 +540,14 @@ def test_image_boots(image_type):
529540
else:
530541
assert_fs_customizations(image_type, test_vm)
531542

543+
# check file/dir customizations
544+
exit_status, output = test_vm.run("stat /etc/some-file", user=image_type.username, password=image_type.password)
545+
assert exit_status == 0
546+
assert "File: /etc/some-file" in output
547+
_, output = test_vm.run("stat /etc/some-dir", user=image_type.username, password=image_type.password)
548+
assert exit_status == 0
549+
assert "File: /etc/some-dir" in output
550+
532551

533552
@pytest.mark.parametrize("image_type", gen_testcases("ami-boot"), indirect=["image_type"])
534553
def test_ami_boots_in_aws(image_type, force_aws_upload):

0 commit comments

Comments
 (0)