What We’re Testing
ztna install and ztna uninstall are defined in cmd_install.go. The command installs the quickztna-svc daemon binary as a system service so that the VPN starts automatically on boot without requiring a logged-in user.
Linux (systemd)
ztna install on Linux:
- Looks for
quickztna-svcin the same directory as theztnabinary, then falls back toPATH. - Copies
quickztna-svcto/usr/local/bin/quickztna-svcif it is not already there. - Writes the systemd unit file to
/etc/systemd/system/quickztna-svc.service. - Runs
systemctl daemon-reload,systemctl enable quickztna-svc.service,systemctl start quickztna-svc.service. - Prints “QuickZTNA service installed and started.” and “Run ‘ztna login’ to authenticate.”
Config directory written to the unit Environment=: /etc/quickztna
Service type in unit: Type=simple
Restart policy: Restart=on-failure, RestartSec=5
LimitNOFILE: 65535
ztna uninstall on Linux:
- Runs
systemctl stop,systemctl disable, removes the unit file, reloads daemon, removes/usr/local/bin/quickztna-svc.
Unit file path: /etc/systemd/system/quickztna-svc.service
Service binary path: /usr/local/bin/quickztna-svc
Windows (SCM)
ztna install on Windows:
- Looks for
quickztna-svc.exein the same directory asztna.exe. - Runs
quickztna-svc.exe install(the service binary registers itself with the Windows Service Control Manager). - Runs
sc start QuickZTNA. - Prints “QuickZTNA service installed and started.” and “Run ‘ztna login’ to authenticate.”
Windows service name: QuickZTNA
Config directory: %ProgramData%\QuickZTNA\ (set by configDirectory())
ztna uninstall on Windows:
- Runs
sc stop QuickZTNAandsc delete QuickZTNA.
Force Flag
ztna install --force overwrites an existing service installation without returning an error. Without --force, if the unit file or service is already present, the command returns:
service already installed at /etc/systemd/system/quickztna-svc.service (use --force to overwrite)
Your Test Setup
| Machine | Role | Notes |
|---|---|---|
| ⊞ Win-A | Windows service tests | Run as Administrator for service operations |
| 🐧 Linux-C | Linux systemd tests | Run as root or with sudo |
ST1 — Linux systemd Service Install
Objective: Confirm ztna install writes the correct unit file and starts the service.
Pre-condition: quickztna-svc binary is present at /usr/local/bin/quickztna-svc (installed by the install script or built manually).
Steps:
- On 🐧 Linux-C (as root):
ztna install - Verify the unit file:
cat /etc/systemd/system/quickztna-svc.service - Check service status:
systemctl status quickztna-svc.service - Confirm the service is enabled for boot:
systemctl is-enabled quickztna-svc.service
Expected output of ztna install:
QuickZTNA service installed and started.
Run 'ztna login' to authenticate.
Expected unit file contents (key fields):
[Unit]
Description=QuickZTNA Mesh VPN Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/quickztna-svc
Restart=on-failure
RestartSec=5
Environment=QUICKZTNA_CONFIG_DIR=/etc/quickztna
Environment=QUICKZTNA_LOG_LEVEL=info
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
Expected systemctl is-enabled output:
enabled
Pass criteria:
ztna installexits 0.- Unit file exists at
/etc/systemd/system/quickztna-svc.servicewith all required fields. systemctl status quickztna-svc.serviceshowsActive: active (running).systemctl is-enabled quickztna-svc.servicereturnsenabled.
Fail criteria:
systemctl start quickztna-svc.servicefails (checkjournalctl -u quickztna-svc.service).- Unit file is missing
Restart=on-failure(no auto-restart on crash). LimitNOFILEmissing (WireGuard needs high file descriptor limits).
ST2 — Linux Service Already Installed Guard
Objective: Confirm that re-running ztna install without --force returns a clear error.
Steps:
- On 🐧 Linux-C (service already installed from ST1):
ztna install echo "Exit code: $?" - Then with
--force:ztna install --force echo "Exit code: $?"
Expected output without --force:
service already installed at /etc/systemd/system/quickztna-svc.service (use --force to overwrite)
Exit code: 1
Expected output with --force:
QuickZTNA service installed and started.
Run 'ztna login' to authenticate.
Exit code: 0
Pass criteria:
- Without
--force: non-zero exit code and descriptive error message. - With
--force: exits 0, service is restarted cleanly.
Fail criteria:
- Without
--force: command silently overwrites existing service (no error guard). - With
--force: command fails instead of overwriting.
ST3 — Linux Service Survives Reboot
Objective: Confirm the service starts automatically on boot (the enable step in ztna install).
Steps:
- On 🐧 Linux-C , with service installed and running:
systemctl is-enabled quickztna-svc.service # Should return: enabled - Reboot the machine:
sudo reboot - After reboot, SSH back in and check:
systemctl status quickztna-svc.service
Expected output after reboot:
Active: active (running) since ...
Pass criteria:
- Service is in
active (running)state within 30 seconds of boot (afternetwork-online.targetis reached). After=network-online.targetensures it does not start before the network is up.
Fail criteria:
- Service is
inactive (dead)after reboot. - Service failed to start (check
journalctl -u quickztna-svc.service --boot). quickztna-svcbinary was not preserved at/usr/local/bin/quickztna-svcafter reboot.
ST4 — Linux ztna uninstall Cleanup
Objective: Confirm ztna uninstall stops the service, removes the unit file, and removes the service binary.
Steps:
- On 🐧 Linux-C (as root), with service running:
ztna uninstall - Verify all artifacts are removed:
systemctl status quickztna-svc.service ls -la /etc/systemd/system/quickztna-svc.service 2>&1 ls -la /usr/local/bin/quickztna-svc 2>&1 systemctl is-enabled quickztna-svc.service 2>&1
Expected output of ztna uninstall:
QuickZTNA service removed.
Expected output of verification commands:
Unit quickztna-svc.service could not be found.
ls: cannot access '/etc/systemd/system/quickztna-svc.service': No such file or directory
ls: cannot access '/usr/local/bin/quickztna-svc': No such file or directory
Failed to get unit file state for quickztna-svc.service: No such file or directory
Pass criteria:
ztna uninstallexits 0.- Unit file
/etc/systemd/system/quickztna-svc.serviceis deleted. - Binary
/usr/local/bin/quickztna-svcis deleted. systemctl daemon-reloadwas called (unit no longer visible to systemd).- The
ztnaCLI binary at/usr/local/bin/ztnais NOT removed (only the service binary and unit are cleaned up).
Fail criteria:
- Unit file or service binary remains after uninstall.
ztnaCLI binary is accidentally deleted.systemctl status quickztna-svc.servicestill shows the unit as known.
ST5 — Windows Service Install and Uninstall
Objective: Confirm ztna install and ztna uninstall correctly register and remove the QuickZTNA Windows service.
Steps:
- Open an elevated (Administrator) PowerShell on ⊞ Win-A .
- Ensure
quickztna-svc.exeis present alongsideztna.exe:Get-Item "$env:LOCALAPPDATA\Programs\QuickZTNA\ztna-svc.exe" - Install the service:
ztna install - Verify the service:
Get-Service -Name QuickZTNA sc.exe qc QuickZTNA - Uninstall the service:
ztna uninstall - Verify the service is gone:
Get-Service -Name QuickZTNA -ErrorAction SilentlyContinue
Expected output of ztna install:
QuickZTNA service installed and started.
Run 'ztna login' to authenticate.
Expected output of sc.exe qc QuickZTNA (key fields):
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: QuickZTNA
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
BINARY_PATH_NAME : C:\Users\...\AppData\Local\Programs\QuickZTNA\ztna-svc.exe
Expected output of ztna uninstall:
QuickZTNA service removed.
Expected output after uninstall (no service found):
(empty — Get-Service returns nothing)
Pass criteria:
- Service is registered with
AUTO_START(starts on boot). - Service is in
Runningstate immediately afterztna install. - After
ztna uninstall:Get-Service QuickZTNAreturns empty with no error (service fully deleted). ztna.exeandztna-svc.exeremain in the install directory afterztna uninstall(only the SCM registration is removed, not the binaries).
Fail criteria:
ztna installfails: “quickztna-svc not found in … or PATH” — means service binary was not downloaded by the install script.- Service
START_TYPEisDEMAND_STARTrather thanAUTO_START(will not start on boot). ztna.exeis deleted byztna uninstall(only the SCM registration should be removed).
Summary
| Sub-test | Machine | What is verified | Pass signal |
|---|---|---|---|
| ST1 | Linux-C | systemd unit written and service started | Unit file correct; systemctl status active |
| ST2 | Linux-C | Guard against double-install without --force | Non-zero exit without --force; success with it |
| ST3 | Linux-C | Service survives reboot | Active after reboot; After=network-online.target |
| ST4 | Linux-C | ztna uninstall removes all artifacts | Unit file, binary deleted; ztna CLI untouched |
| ST5 | Win-A | Windows service install and uninstall | AUTO_START; fully removed after uninstall |