@@ -277,8 +277,8 @@ TEST_CASE("CustomisationGenerator Raspberry Pi Connect", "[customization]") {
277277 QByteArray script = CustomisationGenerator::generateSystemdScript (settings, token);
278278 QString scriptStr = QString::fromUtf8 (script);
279279
280- REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (" com.raspberrypi.connect " ));
281- REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (" deploy.key " ));
280+ REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (PI_CONNECT_CONFIG_PATH ));
281+ REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (PI_CONNECT_DEPLOY_KEY_FILENAME ));
282282 REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (" test-token-12345" ));
283283 REQUIRE_THAT (scriptStr.toStdString (), ContainsSubstring (" rpi-connect-signin.service" ));
284284}
@@ -448,8 +448,8 @@ TEST_CASE("CustomisationGenerator handles null/empty piConnect token", "[customi
448448 QString scriptStr = QString::fromUtf8 (script);
449449
450450 // Should not include Pi Connect setup if token is empty
451- REQUIRE_FALSE (scriptStr.contains (" com.raspberrypi.connect " ));
452- REQUIRE_FALSE (scriptStr.contains (" deploy.key " ));
451+ REQUIRE_FALSE (scriptStr.contains (PI_CONNECT_CONFIG_PATH ));
452+ REQUIRE_FALSE (scriptStr.contains (PI_CONNECT_DEPLOY_KEY_FILENAME ));
453453}
454454
455455TEST_CASE (" CustomisationGenerator handles invalid keyboard layout" , " [customization][negative]" ) {
@@ -597,13 +597,15 @@ TEST_CASE("CustomisationGenerator generates cloud-init user-data with Pi Connect
597597 QString yaml = QString::fromUtf8 (userdata);
598598
599599 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" write_files:" ));
600- REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" - path: /home/testuser/.config/com.raspberrypi.connect/deploy.key" ));
600+ QString expectedPath = QString (" - path: /home/testuser/" ) + PI_CONNECT_CONFIG_PATH + " /" + PI_CONNECT_DEPLOY_KEY_FILENAME;
601+ REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (expectedPath.toStdString ()));
601602 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" permissions: '0600'" ));
602603 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" owner: testuser:testuser" ));
603604 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" content: |" ));
604605 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" test-token-abcd-1234" ));
605606 REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" runcmd:" ));
606- REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (" install -o testuser -m 700 -d /home/testuser/.config/com.raspberrypi.connect" ));
607+ QString expectedInstallDir = QString (" install -o testuser -m 700 -d /home/testuser/" ) + PI_CONNECT_CONFIG_PATH;
608+ REQUIRE_THAT (yaml.toStdString (), ContainsSubstring (expectedInstallDir.toStdString ()));
607609}
608610
609611TEST_CASE (" CustomisationGenerator generates cloud-init network-config with WiFi" , " [cloudinit][network]" ) {
@@ -701,6 +703,6 @@ TEST_CASE("CustomisationGenerator cloud-init handles empty Pi Connect token", "[
701703
702704 // Should not include write_files or runcmd for Pi Connect
703705 REQUIRE_FALSE (yaml.contains (" write_files:" ));
704- REQUIRE_FALSE (yaml.contains (" com.raspberrypi.connect " ));
706+ REQUIRE_FALSE (yaml.contains (PI_CONNECT_CONFIG_PATH ));
705707}
706708
0 commit comments