SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.04k stars 1.24k forks source link

Dev Feature: Package test script #4561

Open publicarray opened 3 years ago

publicarray commented 3 years ago

While testing packages there are some repetitive steps that could be automated so some degree.

I purpose to create a cli command package for us developers. e.g. sudo spkcli test {packagename}

Things the script could test for:

Synology's Check List

Review Item Review Guideline
INFO: required field Ensure required fields in INFO exists
INFO: deprecated field Ensure deprecated fields in INFO does not exist (from DSM7.0)
Lower priviledge The package should be run with non-privileged user (from DSM7.0)
Package installation The package should be installed successfully
Package start The package should be started successfully
Package stop The package should be stopped successfully
Package upgrade The package should be upgraded successfully
Package uninstall The package should be uninstalled successfully
Offline installation The package should be able to be installed offline
Network activity during installation There should not be any abnormal connection during installation
Security advisor scan The package should not cause any security advisor issue
Antivirus essential scan The package should pass the virus scanning
Clean up/file leftover Files belong to package should be removed after uninstallation
Clean up/process leftover Process belong to package should be stopped after uninstallation
Port-config Register port numbers used by services of package
Port conflict Registered port should not conflict with other services
Error log There should not be any error log left on system
Apparmor log There should not be any deny log from apparmor
Coredump file There should not be any coredump file left on system
Ad-hoc test Check any other abnormal behavior
publicarray commented 3 years ago

Here is a small script I started to make repetitive tasks easier and make managing spksrc easier: https://github.com/publicarray/spkcli/blob/main/spkcli.sh (place file it the root of the project)