@@ -744,6 +744,7 @@ def test_sqlite_database_plugin_executes_transactional_statements(tmp_path: Path
744744 assert select .ok , select .stderr
745745 assert select .data ["scalar" ] == "automax"
746746 assert select .stdout == "automax"
747+ assert plugin .manual_commands ({"database" : str (database ), "query" : "SELECT 1" }, context )[0 ].startswith (f"sqlite3 { database } " )
747748
748749
749750def test_database_plugins_validate_job_yaml (tmp_path : Path ):
@@ -4233,6 +4234,9 @@ def test_ssh_security_plugins_render_manual_commands():
42334234
42344235 assert "ssh-keygen -lf" in registry .get ("ssh.fingerprint" ).manual_commands ({"path" : "/tmp/id.pub" , "sudo" : False }, context )[0 ]
42354236 assert "ssh-keygen -y" in registry .get ("ssh.public_key" ).manual_commands ({"path" : "/tmp/id" , "sudo" : False }, context )[0 ]
4237+ sudo_public_key = registry .get ("ssh.public_key" ).manual_commands ({"path" : "/tmp/id" , "dest" : "/root/id.pub" }, context )[0 ]
4238+ assert "ssh-keygen -y" in sudo_public_key
4239+ assert "| sudo -n tee /root/id.pub >/dev/null" in sudo_public_key
42364240 assert "ssh-keygen -A" in registry .get ("ssh.host_keygen" ).manual_commands ({"sudo" : False }, context )[0 ]
42374241 assert "authorized_keys" in registry .get ("ssh.authorized_key_absent" ).manual_commands ({"user" : "deploy" , "key" : "ssh-ed25519 AAA demo" , "sudo" : False }, context )[0 ]
42384242 assert "sshd -t" in registry .get ("sshd.validate" ).manual_commands ({}, context )[0 ]
@@ -4353,6 +4357,14 @@ def test_backup_completeness_plugins_render_manual_commands():
43534357 assert "find . -type f" in manifest
43544358 assert "tee /var/backups/manifest.txt" in manifest
43554359
4360+ sudo_manifest = registry .get ("backup.manifest" ).manual_commands ({"root" : "/var/backups" , "dest" : "/var/backups/manifest.txt" }, context )[0 ]
4361+ assert "sudo -n sha256sum" in sudo_manifest
4362+ assert "sudo -n tee /var/backups/manifest.txt.sha256 >/dev/null" in sudo_manifest
4363+
4364+ restore = registry .get ("backup.restore" ).manual_commands ({"src" : "/var/backups/file.txt" , "dest" : "/srv/file.txt" , "confirm" : True }, context )[0 ]
4365+ assert "if test -e /srv/file.txt; then sudo -n cp -a /srv/file.txt /srv/file.txt.pre-restore; fi" in restore
4366+ assert "sudo -n cp -a /var/backups/file.txt /srv/file.txt" in restore
4367+
43564368 try :
43574369 registry .get ("backup.prune" ).manual_commands ({"path" : "/var/backups" , "keep" : 7 }, context )
43584370 except PluginValidationError as exc :
0 commit comments