The main dish 
an Array of TestCase
testCases := map[int]tap.TestCase{
1: {"Save original hostname", nil},
2: {"Check polkit rules directory permissions (root:polkitd)", checkPermissions},
3: {"Add polkit rule and restart service", addRuleAndRestart},
4: {"Change hostname without authentication", changeHostnameWithAuth},
5: {"Verify hostname was changed", verifyHostnameChanged},
6: {"Remove polkit rule and restart service", removeRuleAndRestart},
7: {"Hostname change should fail without authentication", changeHostnameShouldFail},
8: {"Verify hostname was not changed", verifyHostnameUnchanged},
9: {"Restore original hostname", nil},
}
- Small , testable functions with simple, straightforward logic.
- You can see the test plan without reading the code.