@@ -31,13 +31,13 @@ subtest 'Provision command is discoverable by app' => sub {
3131
3232subtest ' Template files exist and are readable'   =>  sub  {
3333    my  $project_root  = path($Bin )-> parent-> parent-> parent;
34-     my  $templates_dir  = $project_root -> child(' templates/provision '  );
34+     my  $templates_dir  = $project_root -> child(' templates'  );
3535
36-     ok($templates_dir -> exists , ' Templates/provision  directory exists'  );
37-     ok($templates_dir -> is_dir, ' Templates/provision  directory is a directory'  );
36+     ok($templates_dir -> exists , ' Templates directory exists'  );
37+     ok($templates_dir -> is_dir, ' Templates directory is a directory'  );
3838
3939    my  $main_tf_template  = $templates_dir -> child(' tofu/providers/libvirt/main.tf'  );
40-     my  $cloud_init_template  = $templates_dir -> child(' cloud-init.yml'  );
40+     my  $cloud_init_template  = $templates_dir -> child(' tofu/ cloud-init.yml'  );
4141
4242    ok($main_tf_template -> exists , ' main.tf template exists'  );
4343    ok($main_tf_template -> is_file, ' main.tf template is a file'  );
@@ -50,15 +50,15 @@ subtest 'Template files exist and are readable' => sub {
5050
5151subtest ' Template files have expected content'   =>  sub  {
5252    my  $project_root  = path($Bin )-> parent-> parent-> parent;
53-     my  $templates_dir  = $project_root -> child(' templates/provision '  );
53+     my  $templates_dir  = $project_root -> child(' templates'  );
5454
5555    my  $main_tf_content  = $templates_dir -> child(' tofu/providers/libvirt/main.tf'  )-> slurp_utf8;
5656    like($main_tf_content , qr / required_providers/  , ' main.tf contains provider configuration'  );
5757    like($main_tf_content , qr / libvirt/  , ' main.tf contains libvirt provider'  );
5858    like($main_tf_content , qr / libvirt_domain/  , ' main.tf contains domain resource'  );
5959    like($main_tf_content , qr / torrust-tracker/  , ' main.tf contains torrust-tracker VM name'  );
6060
61-     my  $cloud_init_content  = $templates_dir -> child(' cloud-init.yml'  )-> slurp_utf8;
61+     my  $cloud_init_content  = $templates_dir -> child(' tofu/ cloud-init.yml'  )-> slurp_utf8;
6262    like($cloud_init_content , qr / ^#cloud-config/  , ' cloud-init.yml has cloud-config header'  );
6363    like($cloud_init_content , qr / hostname:\s *torrust-tracker/  , ' cloud-init.yml sets hostname'  );
6464    like($cloud_init_content , qr / name:\s *torrust/  , ' cloud-init.yml creates torrust user'  );
@@ -77,10 +77,10 @@ subtest 'Provision command template copying functionality' => sub {
7777
7878    #  Test the _copy_templates method directly
7979    my  $project_root  = path($Bin )-> parent-> parent-> parent;
80-     my  $templates_dir  = $project_root -> child(' templates/provision '  );
80+     my  $templates_dir  = $project_root -> child(' templates'  );
8181
8282    #  Test that template directory exists
83-     ok($templates_dir -> exists , ' Source templates/provision  directory exists'  );
83+     ok($templates_dir -> exists , ' Source templates directory exists'  );
8484
8585    #  Create the target directory
8686    $test_tofu_dir -> mkpath;
@@ -104,7 +104,7 @@ subtest 'Provision command template copying functionality' => sub {
104104
105105    #  Verify content matches the templates
106106    my  $main_tf_template  = $templates_dir -> child(' tofu/providers/libvirt/main.tf'  );
107-     my  $cloud_init_template  = $templates_dir -> child(' cloud-init.yml'  );
107+     my  $cloud_init_template  = $templates_dir -> child(' tofu/ cloud-init.yml'  );
108108
109109    is($target_main_tf -> slurp_utf8, $main_tf_template -> slurp_utf8, ' main.tf content matches template'  );
110110    is($target_cloud_init -> slurp_utf8, $cloud_init_template -> slurp_utf8, ' cloud-init.yml content matches template'  );
0 commit comments