Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests fail when executed as root as opposed to ubuntu #263

Closed
shayancanonical opened this issue Jul 27, 2023 · 5 comments
Closed

Some tests fail when executed as root as opposed to ubuntu #263

shayancanonical opened this issue Jul 27, 2023 · 5 comments

Comments

@shayancanonical
Copy link
Contributor

shayancanonical commented Jul 27, 2023

Test output when running test as root:

root@host:/home/ubuntu/mnt/pebble# PEBBLE_TEST_USER=root PEBBLE_TEST_GROUP=root go test ./internals/daemon -v -check.v 
=== RUN   Test
2023-07-27T22:00:26.815Z [test] Started daemon.
2023-07-27T22:00:26.822Z [test] POST /v1/exec 6.58337ms 202
2023-07-27T22:00:26.830Z [test] GET /v1/tasks/1/websocket/control 6.566366ms 200
2023-07-27T22:00:26.830Z [test] GET /v1/tasks/1/websocket/stdio 108.446µs 200
2023-07-27T22:00:26.847Z [test] GET /v1/changes/1/wait 15.826837ms 200
PASS: api_exec_test.go:89: execSuite.TestCombinedStderr	0.034s
2023-07-27T22:00:26.871Z [test] Started daemon.
PASS: api_exec_test.go:381: execSuite.TestCommandNotFound	0.001s
2023-07-27T22:00:26.882Z [test] Started daemon.
2023-07-27T22:00:26.888Z [test] POST /v1/exec 4.737871ms 202
2023-07-27T22:00:26.894Z [test] GET /v1/tasks/1/websocket/control 5.391712ms 200
2023-07-27T22:00:26.895Z [test] GET /v1/tasks/1/websocket/stdio 103.321µs 200
2023-07-27T22:00:26.895Z [test] GET /v1/tasks/1/websocket/stderr 54.958µs 200
2023-07-27T22:00:26.906Z [test] GET /v1/changes/1/wait 10.109912ms 200
PASS: api_exec_test.go:168: execSuite.TestContextNoOverrides	0.024s
2023-07-27T22:00:26.919Z [test] Started daemon.
2023-07-27T22:00:26.925Z [test] POST /v1/exec 4.579363ms 202
2023-07-27T22:00:26.933Z [test] GET /v1/tasks/1/websocket/control 6.966243ms 200
2023-07-27T22:00:26.934Z [test] GET /v1/tasks/1/websocket/stdio 131.454µs 200
2023-07-27T22:00:26.935Z [test] GET /v1/tasks/1/websocket/stderr 118.5µs 200
2023-07-27T22:00:26.946Z [test] GET /v1/changes/1/wait 11.636895ms 200
PASS: api_exec_test.go:191: execSuite.TestContextOverrides	0.027s
2023-07-27T22:00:26.958Z [test] Started daemon.
2023-07-27T22:00:26.964Z [test] POST /v1/exec 5.049098ms 202
2023-07-27T22:00:26.970Z [test] GET /v1/tasks/1/websocket/control 4.835584ms 200
2023-07-27T22:00:26.971Z [test] GET /v1/tasks/1/websocket/stdio 144.12µs 200
2023-07-27T22:00:26.971Z [test] GET /v1/tasks/1/websocket/stderr 87.705µs 200
2023-07-27T22:00:26.988Z [test] GET /v1/changes/1/wait 15.656281ms 200
PASS: api_exec_test.go:216: execSuite.TestCurrentUserGroup	0.030s
2023-07-27T22:00:27.025Z [test] Started daemon.
2023-07-27T22:00:27.040Z [test] POST /v1/exec 5.727182ms 202
2023-07-27T22:00:27.045Z [test] GET /v1/tasks/1/websocket/control 4.327464ms 200
2023-07-27T22:00:27.046Z [test] GET /v1/tasks/1/websocket/stdio 145.406µs 200
2023-07-27T22:00:27.046Z [test] GET /v1/tasks/1/websocket/stderr 79.553µs 200
2023-07-27T22:00:27.066Z [test] GET /v1/changes/1/wait 19.506471ms 200
PASS: api_exec_test.go:102: execSuite.TestEnvironment	0.041s
2023-07-27T22:00:27.082Z [test] Started daemon.
2023-07-27T22:00:27.089Z [test] POST /v1/exec 5.288108ms 202
2023-07-27T22:00:27.095Z [test] GET /v1/tasks/1/websocket/control 4.093929ms 200
2023-07-27T22:00:27.095Z [test] GET /v1/tasks/1/websocket/stdio 104.784µs 200
2023-07-27T22:00:27.095Z [test] GET /v1/tasks/1/websocket/stderr 83.331µs 200
2023-07-27T22:00:27.117Z [test] GET /v1/changes/1/wait 21.406203ms 200
2023-07-27T22:00:27.123Z [test] POST /v1/exec 5.334909ms 202
2023-07-27T22:00:27.129Z [test] GET /v1/tasks/2/websocket/stdio 65.344µs 200
2023-07-27T22:00:27.130Z [test] GET /v1/tasks/2/websocket/stderr 52.91µs 200
2023-07-27T22:00:27.131Z [test] GET /v1/tasks/2/websocket/control 3.815817ms 200
2023-07-27T22:00:27.142Z [test] GET /v1/changes/2/wait 11.676712ms 200
PASS: api_exec_test.go:112: execSuite.TestEnvironmentInheritedFromDaemon	0.060s
2023-07-27T22:00:27.160Z [test] Started daemon.
2023-07-27T22:00:27.173Z [test] POST /v1/exec 9.611424ms 202
2023-07-27T22:00:27.179Z [test] GET /v1/tasks/1/websocket/control 5.703408ms 200
2023-07-27T22:00:27.179Z [test] GET /v1/tasks/1/websocket/stdio 106.854µs 200
2023-07-27T22:00:27.180Z [test] GET /v1/tasks/1/websocket/stderr 86.995µs 200
2023-07-27T22:00:27.193Z [test] GET /v1/changes/1/wait 11.651299ms 200
PASS: api_exec_test.go:144: execSuite.TestExitError	0.031s
2023-07-27T22:00:27.204Z [test] Started daemon.
PASS: api_exec_test.go:373: execSuite.TestNoCommand	0.000s
2023-07-27T22:00:27.217Z [test] Started daemon.
2023-07-27T22:00:27.224Z [test] POST /v1/exec 5.931887ms 202
2023-07-27T22:00:27.231Z [test] GET /v1/tasks/1/websocket/control 5.672115ms 200
2023-07-27T22:00:27.231Z [test] GET /v1/tasks/1/websocket/stdio 117.122µs 200
2023-07-27T22:00:27.232Z [test] GET /v1/tasks/1/websocket/stderr 322.359µs 200
2023-07-27T22:00:27.236Z [test] Exec 1: forwarded signal SIGINT to PID 4056211
2023-07-27T22:00:27.246Z [test] GET /v1/changes/1/wait 10.278097ms 200
PASS: api_exec_test.go:291: execSuite.TestSignal	0.029s
2023-07-27T22:00:27.263Z [test] Started daemon.
2023-07-27T22:00:27.292Z [test] POST /v1/exec 21.088634ms 202
2023-07-27T22:00:27.297Z [test] GET /v1/tasks/1/websocket/control 3.99586ms 200
2023-07-27T22:00:27.298Z [test] GET /v1/tasks/1/websocket/stdio 137.069µs 200
2023-07-27T22:00:27.298Z [test] GET /v1/tasks/1/websocket/stderr 175.623µs 200
2023-07-27T22:00:27.314Z [test] GET /v1/changes/1/wait 15.629772ms 200
PASS: api_exec_test.go:80: execSuite.TestStderr	0.044s
2023-07-27T22:00:27.325Z [test] Started daemon.
2023-07-27T22:00:27.336Z [test] POST /v1/exec 6.934213ms 202
2023-07-27T22:00:27.341Z [test] GET /v1/tasks/1/websocket/control 4.62243ms 200
2023-07-27T22:00:27.342Z [test] GET /v1/tasks/1/websocket/stdio 68.651µs 200
2023-07-27T22:00:27.342Z [test] GET /v1/tasks/1/websocket/stderr 57.739µs 200
2023-07-27T22:00:27.356Z [test] GET /v1/changes/1/wait 13.776916ms 200
PASS: api_exec_test.go:71: execSuite.TestStdinStdout	0.031s
2023-07-27T22:00:27.369Z [test] Started daemon.
2023-07-27T22:00:27.376Z [test] POST /v1/exec 5.653356ms 202
2023-07-27T22:00:27.381Z [test] GET /v1/tasks/1/websocket/control 5.1053ms 200
2023-07-27T22:00:27.382Z [test] GET /v1/tasks/1/websocket/stdio 70.31µs 200
2023-07-27T22:00:27.383Z [test] GET /v1/tasks/1/websocket/stderr 79.163µs 200
2023-07-27T22:00:27.414Z [test] GET /v1/changes/1/wait 16.304774ms 200
PASS: api_exec_test.go:314: execSuite.TestStreaming	0.045s
2023-07-27T22:00:27.428Z [test] Started daemon.
2023-07-27T22:00:27.435Z [test] POST /v1/exec 4.977412ms 202
2023-07-27T22:00:27.439Z [test] GET /v1/tasks/1/websocket/control 3.5163ms 200
2023-07-27T22:00:27.440Z [test] GET /v1/tasks/1/websocket/stdio 67.421µs 200
2023-07-27T22:00:27.440Z [test] GET /v1/tasks/1/websocket/stderr 73.959µs 200
2023-07-27T22:00:27.466Z [test] GET /v1/changes/1/wait?timeout=1.01s 25.055374ms 200
PASS: api_exec_test.go:158: execSuite.TestTimeout	0.037s
2023-07-27T22:00:27.487Z [test] Started daemon.
2023-07-27T22:00:27.493Z [test] POST /v1/exec 4.881036ms 202
2023-07-27T22:00:27.497Z [test] GET /v1/tasks/1/websocket/control 3.560545ms 200
2023-07-27T22:00:27.498Z [test] GET /v1/tasks/1/websocket/stdio 110.214µs 200
2023-07-27T22:00:27.498Z [test] GET /v1/tasks/1/websocket/stderr 123.482µs 200
2023-07-27T22:00:27.512Z [test] GET /v1/changes/1/wait 13.595599ms 200
PASS: api_exec_test.go:232: execSuite.TestUserGroup	0.025s
2023-07-27T22:00:27.523Z [test] Started daemon.
PASS: api_exec_test.go:391: execSuite.TestUserGroupError	0.000s
2023-07-27T22:00:27.533Z [test] Started daemon.
2023-07-27T22:00:27.540Z [test] POST /v1/exec 4.96362ms 202
2023-07-27T22:00:27.545Z [test] GET /v1/tasks/1/websocket/control 4.38436ms 200
2023-07-27T22:00:27.546Z [test] GET /v1/tasks/1/websocket/stdio 158.645µs 200
2023-07-27T22:00:27.547Z [test] GET /v1/tasks/1/websocket/stderr 277.128µs 200
2023-07-27T22:00:27.563Z [test] GET /v1/changes/1/wait 13.896934ms 200
PASS: api_exec_test.go:252: execSuite.TestUserIDGroupID	0.029s
2023-07-27T22:00:27.575Z [test] Started daemon.
2023-07-27T22:00:27.582Z [test] POST /v1/exec 6.17408ms 202
2023-07-27T22:00:27.587Z [test] GET /v1/tasks/1/websocket/control 3.779895ms 200
2023-07-27T22:00:27.589Z [test] GET /v1/tasks/1/websocket/stdio 217.026µs 200
2023-07-27T22:00:27.589Z [test] GET /v1/tasks/1/websocket/stderr 92.764µs 200
2023-07-27T22:00:27.601Z [test] GET /v1/changes/1/wait 12.155314ms 200
PASS: api_exec_test.go:133: execSuite.TestWorkingDir	0.026s
PASS: api_files_test.go:44: filesSuite.TestGetFilesInvalidAction	0.000s
PASS: api_files_test.go:100: filesSuite.TestListFilesDir	0.001s
PASS: api_files_test.go:120: filesSuite.TestListFilesDirItself	0.001s
PASS: api_files_test.go:151: filesSuite.TestListFilesFile	0.001s
PASS: api_files_test.go:51: filesSuite.TestListFilesNoPath	0.000s
PASS: api_files_test.go:165: filesSuite.TestListFilesNoResults	0.000s
PASS: api_files_test.go:61: filesSuite.TestListFilesNonAbsPath	0.000s
PASS: api_files_test.go:86: filesSuite.TestListFilesNotFound	0.001s

----------------------------------------------------------------------
FAIL: api_files_test.go:71: filesSuite.TestListFilesPermissionDenied

api_files_test.go:82:
    c.Assert(response.StatusCode, Equals, http.StatusForbidden)
... obtained int = 200
... expected int = 403


----------------------------------------------------------------------
PASS: api_files_test.go:135: filesSuite.TestListFilesWithPattern	0.001s
PASS: api_files_test.go:398: filesSuite.TestMakeDirsMultiple	0.002s
PASS: api_files_test.go:368: filesSuite.TestMakeDirsSingle	0.000s
PASS: api_files_test.go:440: filesSuite.TestMakeDirsUserGroupMocked	0.001s
PASS: api_files_test.go:535: filesSuite.TestMakeDirsUserGroupReal	0.012s
PASS: api_files_test.go:353: filesSuite.TestPostFilesInvalidAction	0.003s
PASS: api_files_test.go:340: filesSuite.TestPostFilesInvalidContentType	0.001s
PASS: api_files_test.go:234: filesSuite.TestReadErrorOnRead	0.001s

----------------------------------------------------------------------
FAIL: api_files_test.go:303: filesSuite.TestReadErrors

api_files_test.go:331:
    checkFileResult(c, r.Result[2], tmpDir+"/no-access", "permission-denied", ".*: permission denied")
api_files_test.go:269:
    c.Check(r.Error.Kind, Equals, errorKind)
... obtained string = ""
... expected string = "permission-denied"

api_files_test.go:331:
    checkFileResult(c, r.Result[2], tmpDir+"/no-access", "permission-denied", ".*: permission denied")
api_files_test.go:270:
    c.Check(r.Error.Message, Matches, errorMsg)
... value string = ""
... regex string = ".*: permission denied"

api_files_test.go:335:
    c.Check(files, DeepEquals, map[string]string{
        tmpDir + "/foo": "a",
    })
... obtained map[string]string = map[string]string{"/tmp/check-2829469502/11/foo":"a", "/tmp/check-2829469502/11/no-access":"x"}
... expected map[string]string = map[string]string{"/tmp/check-2829469502/11/foo":"a"}
... Difference:
...     ["/tmp/check-2829469502/11/no-access"]: "x" != (missing)



----------------------------------------------------------------------
PASS: api_files_test.go:273: filesSuite.TestReadMultiple	0.001s
PASS: api_files_test.go:186: filesSuite.TestReadNoMultipartHeader	0.000s
PASS: api_files_test.go:179: filesSuite.TestReadNoPaths	0.000s
PASS: api_files_test.go:208: filesSuite.TestReadSingle	0.001s
PASS: api_files_test.go:631: filesSuite.TestRemoveMultiple	0.001s
PASS: api_files_test.go:600: filesSuite.TestRemoveSingle	0.000s

----------------------------------------------------------------------
FAIL: api_files_test.go:1123: filesSuite.TestWriteErrors

api_files_test.go:1185:
    checkFileResult(c, r.Result[3], pathPermissionDenied, "permission-denied", ".*")
api_files_test.go:269:
    c.Check(r.Error.Kind, Equals, errorKind)
... obtained string = ""
... expected string = "permission-denied"

api_files_test.go:1192:
    c.Check(osutil.CanStat(pathPermissionDenied), Equals, false)
... obtained bool = true
... expected bool = false


----------------------------------------------------------------------
PASS: api_files_test.go:685: filesSuite.TestWriteInvalidBoundary	0.000s
PASS: api_files_test.go:717: filesSuite.TestWriteInvalidFileField	0.000s
PASS: api_files_test.go:761: filesSuite.TestWriteInvalidMetadata	0.000s
PASS: api_files_test.go:701: filesSuite.TestWriteInvalidRequestField	0.000s
PASS: api_files_test.go:872: filesSuite.TestWriteMultiple	0.014s
PASS: api_files_test.go:788: filesSuite.TestWriteNoFiles	0.000s
PASS: api_files_test.go:676: filesSuite.TestWriteNoMetadata	0.000s
PASS: api_files_test.go:739: filesSuite.TestWriteNoMetadataForPath	0.000s
PASS: api_files_test.go:837: filesSuite.TestWriteOverwrite	0.008s
PASS: api_files_test.go:804: filesSuite.TestWriteSingle	0.005s
PASS: api_files_test.go:934: filesSuite.TestWriteUserGroupMocked	0.022s
PASS: api_files_test.go:987: filesSuite.TestWriteUserGroupReal	0.030s
PASS: api_health_test.go:178: healthSuite.TestBadLevel	0.000s
2023-07-27T22:00:27.780Z [test] Cannot fetch checks: oops!
PASS: api_health_test.go:192: healthSuite.TestChecksError	0.001s
PASS: api_health_test.go:49: healthSuite.TestHealthy	0.000s
PASS: api_health_test.go:84: healthSuite.TestLevel	0.001s
PASS: api_health_test.go:143: healthSuite.TestNames	0.001s
PASS: api_health_test.go:35: healthSuite.TestNoChecks	0.000s
PASS: api_health_test.go:66: healthSuite.TestUnhealthy	0.000s
PASS: api_logs_test.go:89: logsSuite.TestInvalidFollow	0.001s
PASS: api_logs_test.go:95: logsSuite.TestInvalidN	0.000s
PASS: api_logs_test.go:315: logsSuite.TestLoggingTooFast	0.002s
PASS: api_logs_test.go:232: logsSuite.TestMultipleServicesAll	0.024s
PASS: api_logs_test.go:380: logsSuite.TestMultipleServicesFollow	0.014s
PASS: api_logs_test.go:261: logsSuite.TestMultipleServicesN	0.072s
PASS: api_logs_test.go:290: logsSuite.TestMultipleServicesNFewLogs	0.003s
PASS: api_logs_test.go:217: logsSuite.TestNoLogs	0.000s
PASS: api_logs_test.go:171: logsSuite.TestOneServiceAllLogs	0.001s
PASS: api_logs_test.go:123: logsSuite.TestOneServiceDefaults	0.001s
PASS: api_logs_test.go:194: logsSuite.TestOneServiceOutOfTwo	0.000s
PASS: api_logs_test.go:149: logsSuite.TestOneServiceWithN	0.001s
PASS: api_logs_test.go:114: logsSuite.TestServiceLogsError	0.000s
PASS: api_logs_test.go:105: logsSuite.TestServicesError	0.000s
PASS: api_warnings_test.go:80: apiSuite.TestAckWarnings	0.010s
PASS: api_warnings_test.go:68: apiSuite.TestAllWarnings	0.011s
PASS: api_checks_test.go:152: apiSuite.TestChecksEmpty	0.009s
PASS: api_checks_test.go:25: apiSuite.TestChecksGet	0.010s
PASS: api_checks_test.go:130: apiSuite.TestChecksGetInvalidLevel	0.009s
PASS: api_plan_test.go:61: apiSuite.TestGetPlan	0.010s
PASS: api_plan_test.go:35: apiSuite.TestGetPlanErrors	0.010s
PASS: api_plan_test.go:130: apiSuite.TestLayersAddAppend	0.011s
PASS: api_plan_test.go:157: apiSuite.TestLayersAddCombine	0.021s
PASS: api_plan_test.go:184: apiSuite.TestLayersCombineFormatError	0.012s
PASS: api_plan_test.go:101: apiSuite.TestLayersErrors	0.010s
PASS: api_services_test.go:163: apiSuite.TestServicesAutoStart	0.015s
PASS: api_services_test.go:206: apiSuite.TestServicesGet	0.012s
PASS: api_services_test.go:283: apiSuite.TestServicesReplan	0.014s
PASS: api_services_test.go:325: apiSuite.TestServicesReplanNoServices	0.014s
PASS: api_services_test.go:234: apiSuite.TestServicesRestart	0.015s
PASS: api_services_test.go:69: apiSuite.TestServicesStart	0.017s
PASS: api_services_test.go:116: apiSuite.TestServicesStop	0.014s
PASS: api_signals_test.go:97: apiSuite.TestSignalsBadBody	0.000s
PASS: api_signals_test.go:110: apiSuite.TestSignalsNoServices	0.000s
2023-07-27T22:00:28.168Z [test] Service "test1" starting: sleep 10
2023-07-27T22:00:28.169Z [test] Sending SIGTERM to service "test1"
PASS: api_signals_test.go:28: apiSuite.TestSignalsSend	0.027s
PASS: api_signals_test.go:123: apiSuite.TestSignalsServiceNotRunning	0.014s
PASS: api_warnings_test.go:74: apiSuite.TestSomeWarnings	0.010s
PASS: api_changes_test.go:194: apiSuite.TestStateChange	0.016s
PASS: api_changes_test.go:263: apiSuite.TestStateChangeAbort	0.018s
PASS: api_changes_test.go:336: apiSuite.TestStateChangeAbortIsReady	0.016s
PASS: api_changes_test.go:106: apiSuite.TestStateChangesAll	0.016s
PASS: api_changes_test.go:48: apiSuite.TestStateChangesDefaultToInProgress	0.014s
2023-07-27T22:00:28.301Z [test] Cannot get service-name for change 2
PASS: api_changes_test.go:163: apiSuite.TestStateChangesForServiceName	0.016s
PASS: api_changes_test.go:77: apiSuite.TestStateChangesInProgress	0.016s
PASS: api_changes_test.go:135: apiSuite.TestStateChangesReady	0.017s
PASS: api_test.go:75: apiSuite.TestSysInfo	0.010s
PASS: api_changes_test.go:414: apiSuite.TestWaitChangeCancel	0.014s
PASS: api_changes_test.go:382: apiSuite.TestWaitChangeInvalidTimeout	0.016s
PASS: api_changes_test.go:374: apiSuite.TestWaitChangeNotFound	0.012s
PASS: api_changes_test.go:391: apiSuite.TestWaitChangeSuccess	0.030s
PASS: api_changes_test.go:426: apiSuite.TestWaitChangeTimeout	0.025s
PASS: api_changes_test.go:435: apiSuite.TestWaitChangeTimeoutCancel	0.017s
PASS: daemon_test.go:398: daemonSuite.TestAddRoutes	0.011s
PASS: daemon_test.go:118: daemonSuite.TestCommandMethodDispatch	0.009s
PASS: daemon_test.go:158: daemonSuite.TestCommandRestartingState	0.008s
PASS: daemon_test.go:1006: daemonSuite.TestConnTrackerCanShutdown	0.000s
PASS: daemon_test.go:1027: daemonSuite.TestDegradedModeReply	0.010s
2023-07-27T22:00:28.520Z [test] Started daemon.
PASS: daemon_test.go:101: daemonSuite.TestExplicitPaths	0.011s
PASS: daemon_test.go:208: daemonSuite.TestFillsWarnings	0.015s
2023-07-27T22:00:28.748Z [test] 127.0.0.1:43630 GET /endp 200.708748ms 200
PASS: daemon_test.go:541: daemonSuite.TestGracefulStop	0.288s
PASS: daemon_test.go:245: daemonSuite.TestGuestAccess	0.010s
2023-07-27T22:00:28.849Z [test] HTTP API server listening on ":0".
2023-07-27T22:00:28.849Z [test] Started daemon.
2023-07-27T22:00:28.851Z [test] 127.0.0.1:54396 GET /v1/checks 27.334µs 401
PASS: daemon_test.go:1057: daemonSuite.TestHTTPAPI	0.015s
PASS: daemon_test.go:340: daemonSuite.TestLoggedInUserAccess	0.010s

----------------------------------------------------------------------
FAIL: daemon_test.go:727: daemonSuite.TestRebootHelper

using shellcheck: ""
daemon_test.go:744:
    c.Assert(err, check.IsNil)
... value *os.SyscallError = &os.SyscallError{Syscall:"waitid", Err:0xa} ("waitid: no child processes")

2023-07-27T22:00:28.877Z [test] pebble was restarted while a system restart was expected, pebble retried to schedule and waited again for a system restart 3 times and is giving up

----------------------------------------------------------------------
PASS: daemon_test.go:903: daemonSuite.TestRestartExpectedRebootGiveUp	0.006s
2023-07-27T22:00:28.884Z [test] pebble was restarted while a system restart was expected, pebble will try to schedule and wait for a system restart again (tenative 1/3)
2023-07-27T22:00:28.897Z [test] Waiting for system reboot
PASS: daemon_test.go:832: daemonSuite.TestRestartExpectedRebootIsMissing	0.113s
PASS: daemon_test.go:883: daemonSuite.TestRestartExpectedRebootOK	0.017s
PASS: daemon_test.go:928: daemonSuite.TestRestartIntoSocketModeNoNewChanges	0.047s
PASS: daemon_test.go:963: daemonSuite.TestRestartIntoSocketModePendingChanges	0.041s
2023-07-27T22:00:29.284Z [test] Waiting for system reboot
PASS: daemon_test.go:800: daemonSuite.TestRestartShutdown	0.278s
2023-07-27T22:00:29.591Z [test] Waiting for system reboot
PASS: daemon_test.go:771: daemonSuite.TestRestartShutdownWithSigtermInBetween	0.205s
2023-07-27T22:00:29.764Z [test] Waiting for system reboot
PASS: daemon_test.go:625: daemonSuite.TestRestartSystemWiring	0.273s
PASS: daemon_test.go:491: daemonSuite.TestRestartWiring	0.010s
PASS: daemon_test.go:448: daemonSuite.TestStartStop	0.010s
2023-07-27T22:00:29.901Z [test] HTTP API server listening on ":0".
2023-07-27T22:00:29.901Z [test] Started daemon.
2023-07-27T22:00:29.912Z [test] Service "test1" starting: sleep 10
2023-07-27T22:00:30.925Z [test] Stopping all running services.
2023-07-27T22:00:30.936Z [test] Service "test1" stopped
PASS: daemon_test.go:1093: daemonSuite.TestStopRunning	1.052s
PASS: daemon_test.go:368: daemonSuite.TestSuperAccess	0.010s
PASS: daemon_test.go:294: daemonSuite.TestUntrustedAccessUntrustedOKWithRoot	0.010s
PASS: daemon_test.go:278: daemonSuite.TestUntrustedAccessUntrustedOKWithUser	0.011s
PASS: daemon_test.go:310: daemonSuite.TestUserAccess	0.008s
PASS: response_test.go:121: responseSuite.TestErrorResponderDoesNotPrintfAlways	0.000s
PASS: response_test.go:106: responseSuite.TestErrorResponderPrintfsWithArgs	0.000s
PASS: response_test.go:78: responseSuite.TestFileResponseSetsContentDisposition	0.007s
PASS: response_test.go:63: responseSuite.TestRespDoesNotSetLocationIfOther	0.000s
PASS: response_test.go:99: responseSuite.TestRespJSONWithNullResult	0.000s
PASS: response_test.go:33: responseSuite.TestRespSetsLocationIfAccepted	0.000s
PASS: response_test.go:48: responseSuite.TestRespSetsLocationIfCreated	0.000s
PASS: ucrednet_test.go:49: ucrednetSuite.TestAcceptConnRemoteAddrString	0.001s
PASS: ucrednet_test.go:105: ucrednetSuite.TestAcceptErrors	0.000s
PASS: ucrednet_test.go:182: ucrednetSuite.TestGet	0.000s
PASS: ucrednet_test.go:161: ucrednetSuite.TestGetBadUid	0.000s
PASS: ucrednet_test.go:154: ucrednetSuite.TestGetNoUid	0.000s
PASS: ucrednet_test.go:168: ucrednetSuite.TestGetNonUcrednet	0.000s
PASS: ucrednet_test.go:175: ucrednetSuite.TestGetNothing	0.000s
PASS: ucrednet_test.go:190: ucrednetSuite.TestGetSneak	0.000s
PASS: ucrednet_test.go:198: ucrednetSuite.TestGetWithZeroPid	0.000s
PASS: ucrednet_test.go:141: ucrednetSuite.TestIdempotentClose	0.000s
PASS: ucrednet_test.go:78: ucrednetSuite.TestNonUnix	0.003s
PASS: ucrednet_test.go:120: ucrednetSuite.TestUcredErrors	0.000s
OOPS: 156 passed, 4 FAILED
--- FAIL: Test (4.21s)
FAIL
FAIL	github.com/canonical/pebble/internals/daemon	4.220s
FAIL

Test output when run as ubuntu:

ubuntu@host:/home/ubuntu/mnt/pebble# PEBBLE_TEST_USER=ubuntu PEBBLE_TEST_GROUP=ubuntu go test ./internals/daemon -v -check.v
=== RUN   Test
2023-07-27T21:59:13.436Z [test] Started daemon.
2023-07-27T21:59:13.442Z [test] POST /v1/exec 5.215271ms 202
2023-07-27T21:59:13.447Z [test] GET /v1/tasks/1/websocket/control 3.592881ms 200
2023-07-27T21:59:13.447Z [test] GET /v1/tasks/1/websocket/stdio 140.047µs 200
2023-07-27T21:59:13.457Z [test] GET /v1/changes/1/wait 9.702257ms 200
PASS: api_exec_test.go:89: execSuite.TestCombinedStderr	0.021s
2023-07-27T21:59:13.468Z [test] Started daemon.
PASS: api_exec_test.go:381: execSuite.TestCommandNotFound	0.000s
2023-07-27T21:59:13.478Z [test] Started daemon.
2023-07-27T21:59:13.484Z [test] POST /v1/exec 4.473053ms 202
2023-07-27T21:59:13.488Z [test] GET /v1/tasks/1/websocket/control 4.019761ms 200
2023-07-27T21:59:13.489Z [test] GET /v1/tasks/1/websocket/stdio 96.398µs 200
2023-07-27T21:59:13.489Z [test] GET /v1/tasks/1/websocket/stderr 76.518µs 200
2023-07-27T21:59:13.501Z [test] GET /v1/changes/1/wait 11.228992ms 200
PASS: api_exec_test.go:168: execSuite.TestContextNoOverrides	0.023s
2023-07-27T21:59:13.511Z [test] Started daemon.
2023-07-27T21:59:13.520Z [test] POST /v1/exec 5.207558ms 202
2023-07-27T21:59:13.526Z [test] GET /v1/tasks/1/websocket/control 4.170017ms 200
2023-07-27T21:59:13.526Z [test] GET /v1/tasks/1/websocket/stdio 114.775µs 200
2023-07-27T21:59:13.527Z [test] GET /v1/tasks/1/websocket/stderr 86.945µs 200
2023-07-27T21:59:13.540Z [test] GET /v1/changes/1/wait 13.302537ms 200
PASS: api_exec_test.go:191: execSuite.TestContextOverrides	0.027s
2023-07-27T21:59:13.556Z [test] Started daemon.
2023-07-27T21:59:13.563Z [test] POST /v1/exec 5.799119ms 202
2023-07-27T21:59:13.568Z [test] GET /v1/tasks/1/websocket/control 3.99343ms 200
2023-07-27T21:59:13.568Z [test] GET /v1/tasks/1/websocket/stdio 100.22µs 200
2023-07-27T21:59:13.570Z [test] GET /v1/tasks/1/websocket/stderr 106.986µs 200
2023-07-27T21:59:13.592Z [test] GET /v1/changes/1/wait 22.435067ms 200
PASS: api_exec_test.go:216: execSuite.TestCurrentUserGroup	0.037s
2023-07-27T21:59:13.604Z [test] Started daemon.
2023-07-27T21:59:13.609Z [test] POST /v1/exec 5.045534ms 202
2023-07-27T21:59:13.614Z [test] GET /v1/tasks/1/websocket/control 3.861823ms 200
2023-07-27T21:59:13.614Z [test] GET /v1/tasks/1/websocket/stdio 84.404µs 200
2023-07-27T21:59:13.615Z [test] GET /v1/tasks/1/websocket/stderr 94.36µs 200
2023-07-27T21:59:13.625Z [test] GET /v1/changes/1/wait 10.296203ms 200
PASS: api_exec_test.go:102: execSuite.TestEnvironment	0.022s
2023-07-27T21:59:13.635Z [test] Started daemon.
2023-07-27T21:59:13.640Z [test] POST /v1/exec 4.31821ms 202
2023-07-27T21:59:13.645Z [test] GET /v1/tasks/1/websocket/control 3.787378ms 200
2023-07-27T21:59:13.645Z [test] GET /v1/tasks/1/websocket/stdio 97.766µs 200
2023-07-27T21:59:13.647Z [test] GET /v1/tasks/1/websocket/stderr 193.851µs 200
2023-07-27T21:59:13.657Z [test] GET /v1/changes/1/wait 9.190282ms 200
2023-07-27T21:59:13.662Z [test] POST /v1/exec 4.684217ms 202
2023-07-27T21:59:13.667Z [test] GET /v1/tasks/2/websocket/control 4.681203ms 200
2023-07-27T21:59:13.668Z [test] GET /v1/tasks/2/websocket/stdio 88.79µs 200
2023-07-27T21:59:13.668Z [test] GET /v1/tasks/2/websocket/stderr 120.059µs 200
2023-07-27T21:59:13.679Z [test] GET /v1/changes/2/wait 11.143217ms 200
PASS: api_exec_test.go:112: execSuite.TestEnvironmentInheritedFromDaemon	0.044s
2023-07-27T21:59:13.689Z [test] Started daemon.
2023-07-27T21:59:13.695Z [test] POST /v1/exec 5.01877ms 202
2023-07-27T21:59:13.700Z [test] GET /v1/tasks/1/websocket/control 4.251735ms 200
2023-07-27T21:59:13.701Z [test] GET /v1/tasks/1/websocket/stdio 93.328µs 200
2023-07-27T21:59:13.701Z [test] GET /v1/tasks/1/websocket/stderr 201.599µs 200
2023-07-27T21:59:13.704Z [test] Exec 1: cannot send SIGKILL to pid 4049919: no such process
2023-07-27T21:59:13.713Z [test] GET /v1/changes/1/wait 11.844489ms 200
PASS: api_exec_test.go:144: execSuite.TestExitError	0.024s
2023-07-27T21:59:13.725Z [test] Started daemon.
PASS: api_exec_test.go:373: execSuite.TestNoCommand	0.000s
2023-07-27T21:59:13.736Z [test] Started daemon.
2023-07-27T21:59:13.751Z [test] POST /v1/exec 12.744518ms 202
2023-07-27T21:59:13.757Z [test] GET /v1/tasks/1/websocket/control 5.196581ms 200
2023-07-27T21:59:13.758Z [test] GET /v1/tasks/1/websocket/stdio 97.99µs 200
2023-07-27T21:59:13.761Z [test] GET /v1/tasks/1/websocket/stderr 93.262µs 200
2023-07-27T21:59:13.764Z [test] Exec 1: forwarded signal SIGINT to PID 4049929
2023-07-27T21:59:13.827Z [test] GET /v1/changes/1/wait 64.963253ms 200
PASS: api_exec_test.go:291: execSuite.TestSignal	0.090s
2023-07-27T21:59:13.838Z [test] Started daemon.
2023-07-27T21:59:13.844Z [test] POST /v1/exec 4.525941ms 202
2023-07-27T21:59:13.848Z [test] GET /v1/tasks/1/websocket/control 3.101941ms 200
2023-07-27T21:59:13.848Z [test] GET /v1/tasks/1/websocket/stdio 101.291µs 200
2023-07-27T21:59:13.849Z [test] GET /v1/tasks/1/websocket/stderr 66.542µs 200
2023-07-27T21:59:13.860Z [test] GET /v1/changes/1/wait 10.646907ms 200
PASS: api_exec_test.go:80: execSuite.TestStderr	0.021s
2023-07-27T21:59:13.872Z [test] Started daemon.
2023-07-27T21:59:13.878Z [test] POST /v1/exec 5.138912ms 202
2023-07-27T21:59:13.883Z [test] GET /v1/tasks/1/websocket/control 4.150956ms 200
2023-07-27T21:59:13.884Z [test] GET /v1/tasks/1/websocket/stdio 114.477µs 200
2023-07-27T21:59:13.884Z [test] GET /v1/tasks/1/websocket/stderr 91.831µs 200
2023-07-27T21:59:13.896Z [test] GET /v1/changes/1/wait 11.79601ms 200
PASS: api_exec_test.go:71: execSuite.TestStdinStdout	0.024s
2023-07-27T21:59:13.912Z [test] Started daemon.
2023-07-27T21:59:13.918Z [test] POST /v1/exec 4.491351ms 202
2023-07-27T21:59:13.924Z [test] GET /v1/tasks/1/websocket/control 4.349298ms 200
2023-07-27T21:59:13.925Z [test] GET /v1/tasks/1/websocket/stdio 100.36µs 200
2023-07-27T21:59:13.927Z [test] GET /v1/tasks/1/websocket/stderr 94.502µs 200
2023-07-27T21:59:13.955Z [test] GET /v1/changes/1/wait 13.187739ms 200
PASS: api_exec_test.go:314: execSuite.TestStreaming	0.042s
2023-07-27T21:59:13.965Z [test] Started daemon.
2023-07-27T21:59:13.972Z [test] POST /v1/exec 4.640732ms 202
2023-07-27T21:59:13.978Z [test] GET /v1/tasks/1/websocket/control 5.470845ms 200
2023-07-27T21:59:13.979Z [test] GET /v1/tasks/1/websocket/stderr 74.946µs 200
2023-07-27T21:59:13.979Z [test] GET /v1/tasks/1/websocket/stdio 945.847µs 200
2023-07-27T21:59:14.018Z [test] GET /v1/changes/1/wait?timeout=1.01s 38.962928ms 200
PASS: api_exec_test.go:158: execSuite.TestTimeout	0.053s
2023-07-27T21:59:14.031Z [test] Started daemon.
SKIP: api_exec_test.go:232: execSuite.TestUserGroup (requires running as root)
2023-07-27T21:59:14.042Z [test] Started daemon.
PASS: api_exec_test.go:391: execSuite.TestUserGroupError	0.000s
2023-07-27T21:59:14.059Z [test] Started daemon.
SKIP: api_exec_test.go:252: execSuite.TestUserIDGroupID (requires running as root)
2023-07-27T21:59:14.070Z [test] Started daemon.
2023-07-27T21:59:14.076Z [test] POST /v1/exec 4.50217ms 202
2023-07-27T21:59:14.080Z [test] GET /v1/tasks/1/websocket/control 4.177817ms 200
2023-07-27T21:59:14.081Z [test] GET /v1/tasks/1/websocket/stdio 102.243µs 200
2023-07-27T21:59:14.082Z [test] GET /v1/tasks/1/websocket/stderr 115.107µs 200
2023-07-27T21:59:14.093Z [test] GET /v1/changes/1/wait 9.740436ms 200
PASS: api_exec_test.go:133: execSuite.TestWorkingDir	0.023s
PASS: api_files_test.go:44: filesSuite.TestGetFilesInvalidAction	0.000s
PASS: api_files_test.go:100: filesSuite.TestListFilesDir	0.001s
PASS: api_files_test.go:120: filesSuite.TestListFilesDirItself	0.001s
PASS: api_files_test.go:151: filesSuite.TestListFilesFile	0.000s
PASS: api_files_test.go:51: filesSuite.TestListFilesNoPath	0.000s
PASS: api_files_test.go:165: filesSuite.TestListFilesNoResults	0.000s
PASS: api_files_test.go:61: filesSuite.TestListFilesNonAbsPath	0.000s
PASS: api_files_test.go:86: filesSuite.TestListFilesNotFound	0.001s
PASS: api_files_test.go:71: filesSuite.TestListFilesPermissionDenied	0.000s
PASS: api_files_test.go:135: filesSuite.TestListFilesWithPattern	0.001s
PASS: api_files_test.go:398: filesSuite.TestMakeDirsMultiple	0.001s
PASS: api_files_test.go:368: filesSuite.TestMakeDirsSingle	0.000s
PASS: api_files_test.go:440: filesSuite.TestMakeDirsUserGroupMocked	0.001s
SKIP: api_files_test.go:535: filesSuite.TestMakeDirsUserGroupReal (requires running as root)
PASS: api_files_test.go:353: filesSuite.TestPostFilesInvalidAction	0.000s
PASS: api_files_test.go:340: filesSuite.TestPostFilesInvalidContentType	0.000s
PASS: api_files_test.go:234: filesSuite.TestReadErrorOnRead	0.000s
PASS: api_files_test.go:303: filesSuite.TestReadErrors	0.001s
PASS: api_files_test.go:273: filesSuite.TestReadMultiple	0.001s
PASS: api_files_test.go:186: filesSuite.TestReadNoMultipartHeader	0.000s
PASS: api_files_test.go:179: filesSuite.TestReadNoPaths	0.000s
PASS: api_files_test.go:208: filesSuite.TestReadSingle	0.001s
PASS: api_files_test.go:631: filesSuite.TestRemoveMultiple	0.001s
PASS: api_files_test.go:600: filesSuite.TestRemoveSingle	0.000s
PASS: api_files_test.go:1123: filesSuite.TestWriteErrors	0.003s
PASS: api_files_test.go:685: filesSuite.TestWriteInvalidBoundary	0.000s
PASS: api_files_test.go:717: filesSuite.TestWriteInvalidFileField	0.000s
PASS: api_files_test.go:761: filesSuite.TestWriteInvalidMetadata	0.000s
PASS: api_files_test.go:701: filesSuite.TestWriteInvalidRequestField	0.000s
PASS: api_files_test.go:872: filesSuite.TestWriteMultiple	0.014s
PASS: api_files_test.go:788: filesSuite.TestWriteNoFiles	0.000s
PASS: api_files_test.go:676: filesSuite.TestWriteNoMetadata	0.000s
PASS: api_files_test.go:739: filesSuite.TestWriteNoMetadataForPath	0.000s
PASS: api_files_test.go:837: filesSuite.TestWriteOverwrite	0.009s
PASS: api_files_test.go:804: filesSuite.TestWriteSingle	0.004s
PASS: api_files_test.go:934: filesSuite.TestWriteUserGroupMocked	0.024s
SKIP: api_files_test.go:987: filesSuite.TestWriteUserGroupReal (requires running as root)
PASS: api_health_test.go:178: healthSuite.TestBadLevel	0.000s
2023-07-27T21:59:14.170Z [test] Cannot fetch checks: oops!
PASS: api_health_test.go:192: healthSuite.TestChecksError	0.000s
PASS: api_health_test.go:49: healthSuite.TestHealthy	0.001s
PASS: api_health_test.go:84: healthSuite.TestLevel	0.001s
PASS: api_health_test.go:143: healthSuite.TestNames	0.000s
PASS: api_health_test.go:35: healthSuite.TestNoChecks	0.000s
PASS: api_health_test.go:66: healthSuite.TestUnhealthy	0.000s
PASS: api_logs_test.go:89: logsSuite.TestInvalidFollow	0.001s
PASS: api_logs_test.go:95: logsSuite.TestInvalidN	0.000s
PASS: api_logs_test.go:315: logsSuite.TestLoggingTooFast	0.000s
PASS: api_logs_test.go:232: logsSuite.TestMultipleServicesAll	0.024s
PASS: api_logs_test.go:380: logsSuite.TestMultipleServicesFollow	0.013s
PASS: api_logs_test.go:261: logsSuite.TestMultipleServicesN	0.069s
PASS: api_logs_test.go:290: logsSuite.TestMultipleServicesNFewLogs	0.003s
PASS: api_logs_test.go:217: logsSuite.TestNoLogs	0.000s
PASS: api_logs_test.go:171: logsSuite.TestOneServiceAllLogs	0.001s
PASS: api_logs_test.go:123: logsSuite.TestOneServiceDefaults	0.001s
PASS: api_logs_test.go:194: logsSuite.TestOneServiceOutOfTwo	0.000s
PASS: api_logs_test.go:149: logsSuite.TestOneServiceWithN	0.001s
PASS: api_logs_test.go:114: logsSuite.TestServiceLogsError	0.001s
PASS: api_logs_test.go:105: logsSuite.TestServicesError	0.000s
PASS: api_warnings_test.go:80: apiSuite.TestAckWarnings	0.011s
PASS: api_warnings_test.go:68: apiSuite.TestAllWarnings	0.010s
PASS: api_checks_test.go:152: apiSuite.TestChecksEmpty	0.011s
PASS: api_checks_test.go:25: apiSuite.TestChecksGet	0.015s
PASS: api_checks_test.go:130: apiSuite.TestChecksGetInvalidLevel	0.010s
PASS: api_plan_test.go:61: apiSuite.TestGetPlan	0.011s
PASS: api_plan_test.go:35: apiSuite.TestGetPlanErrors	0.011s
PASS: api_plan_test.go:130: apiSuite.TestLayersAddAppend	0.013s
PASS: api_plan_test.go:157: apiSuite.TestLayersAddCombine	0.011s
PASS: api_plan_test.go:184: apiSuite.TestLayersCombineFormatError	0.011s
PASS: api_plan_test.go:101: apiSuite.TestLayersErrors	0.011s
PASS: api_services_test.go:163: apiSuite.TestServicesAutoStart	0.018s
PASS: api_services_test.go:206: apiSuite.TestServicesGet	0.012s
PASS: api_services_test.go:283: apiSuite.TestServicesReplan	0.014s
PASS: api_services_test.go:325: apiSuite.TestServicesReplanNoServices	0.013s
PASS: api_services_test.go:234: apiSuite.TestServicesRestart	0.018s
PASS: api_services_test.go:69: apiSuite.TestServicesStart	0.017s
PASS: api_services_test.go:116: apiSuite.TestServicesStop	0.015s
PASS: api_signals_test.go:97: apiSuite.TestSignalsBadBody	0.000s
PASS: api_signals_test.go:110: apiSuite.TestSignalsNoServices	0.001s
2023-07-27T21:59:14.576Z [test] Service "test1" starting: sleep 10
2023-07-27T21:59:14.589Z [test] Sending SIGTERM to service "test1"
PASS: api_signals_test.go:28: apiSuite.TestSignalsSend	0.059s
PASS: api_signals_test.go:123: apiSuite.TestSignalsServiceNotRunning	0.012s
PASS: api_warnings_test.go:74: apiSuite.TestSomeWarnings	0.008s
PASS: api_changes_test.go:194: apiSuite.TestStateChange	0.013s
PASS: api_changes_test.go:263: apiSuite.TestStateChangeAbort	0.019s
PASS: api_changes_test.go:336: apiSuite.TestStateChangeAbortIsReady	0.025s
PASS: api_changes_test.go:106: apiSuite.TestStateChangesAll	0.018s
PASS: api_changes_test.go:48: apiSuite.TestStateChangesDefaultToInProgress	0.015s
2023-07-27T21:59:14.738Z [test] Cannot get service-name for change 2
PASS: api_changes_test.go:163: apiSuite.TestStateChangesForServiceName	0.014s
PASS: api_changes_test.go:77: apiSuite.TestStateChangesInProgress	0.015s
PASS: api_changes_test.go:135: apiSuite.TestStateChangesReady	0.018s
PASS: api_test.go:75: apiSuite.TestSysInfo	0.010s
PASS: api_changes_test.go:414: apiSuite.TestWaitChangeCancel	0.012s
PASS: api_changes_test.go:382: apiSuite.TestWaitChangeInvalidTimeout	0.013s
PASS: api_changes_test.go:374: apiSuite.TestWaitChangeNotFound	0.013s
PASS: api_changes_test.go:391: apiSuite.TestWaitChangeSuccess	0.035s
PASS: api_changes_test.go:426: apiSuite.TestWaitChangeTimeout	0.028s
PASS: api_changes_test.go:435: apiSuite.TestWaitChangeTimeoutCancel	0.017s
PASS: daemon_test.go:398: daemonSuite.TestAddRoutes	0.011s
PASS: daemon_test.go:118: daemonSuite.TestCommandMethodDispatch	0.010s
PASS: daemon_test.go:158: daemonSuite.TestCommandRestartingState	0.011s
PASS: daemon_test.go:1006: daemonSuite.TestConnTrackerCanShutdown	0.000s
PASS: daemon_test.go:1027: daemonSuite.TestDegradedModeReply	0.009s
2023-07-27T21:59:14.968Z [test] Started daemon.
PASS: daemon_test.go:101: daemonSuite.TestExplicitPaths	0.010s
PASS: daemon_test.go:208: daemonSuite.TestFillsWarnings	0.014s
2023-07-27T21:59:15.194Z [test] 127.0.0.1:57342 GET /endp 201.17423ms 200
PASS: daemon_test.go:541: daemonSuite.TestGracefulStop	0.311s
PASS: daemon_test.go:245: daemonSuite.TestGuestAccess	0.011s
2023-07-27T21:59:15.318Z [test] HTTP API server listening on ":0".
2023-07-27T21:59:15.318Z [test] Started daemon.
2023-07-27T21:59:15.320Z [test] 127.0.0.1:44810 GET /v1/checks 28.339µs 401
PASS: daemon_test.go:1057: daemonSuite.TestHTTPAPI	0.015s
PASS: daemon_test.go:340: daemonSuite.TestLoggedInUserAccess	0.011s
PASS: daemon_test.go:727: daemonSuite.TestRebootHelper	0.022s
2023-07-27T21:59:15.357Z [test] pebble was restarted while a system restart was expected, pebble retried to schedule and waited again for a system restart 3 times and is giving up
PASS: daemon_test.go:903: daemonSuite.TestRestartExpectedRebootGiveUp	0.006s
2023-07-27T21:59:15.363Z [test] pebble was restarted while a system restart was expected, pebble will try to schedule and wait for a system restart again (tenative 1/3)
2023-07-27T21:59:15.392Z [test] Waiting for system reboot
PASS: daemon_test.go:832: daemonSuite.TestRestartExpectedRebootIsMissing	0.130s
PASS: daemon_test.go:883: daemonSuite.TestRestartExpectedRebootOK	0.008s
PASS: daemon_test.go:928: daemonSuite.TestRestartIntoSocketModeNoNewChanges	0.048s
PASS: daemon_test.go:963: daemonSuite.TestRestartIntoSocketModePendingChanges	0.049s
2023-07-27T21:59:15.778Z [test] Waiting for system reboot
PASS: daemon_test.go:800: daemonSuite.TestRestartShutdown	0.277s
2023-07-27T21:59:16.059Z [test] Waiting for system reboot
PASS: daemon_test.go:771: daemonSuite.TestRestartShutdownWithSigtermInBetween	0.180s
2023-07-27T21:59:16.234Z [test] Waiting for system reboot
PASS: daemon_test.go:625: daemonSuite.TestRestartSystemWiring	0.274s
PASS: daemon_test.go:491: daemonSuite.TestRestartWiring	0.011s
PASS: daemon_test.go:448: daemonSuite.TestStartStop	0.010s
2023-07-27T21:59:16.366Z [test] HTTP API server listening on ":0".
2023-07-27T21:59:16.366Z [test] Started daemon.
2023-07-27T21:59:16.378Z [test] Service "test1" starting: sleep 10
2023-07-27T21:59:17.436Z [test] Stopping all running services.
2023-07-27T21:59:17.445Z [test] Service "test1" stopped
PASS: daemon_test.go:1093: daemonSuite.TestStopRunning	1.094s
PASS: daemon_test.go:368: daemonSuite.TestSuperAccess	0.010s
PASS: daemon_test.go:294: daemonSuite.TestUntrustedAccessUntrustedOKWithRoot	0.009s
PASS: daemon_test.go:278: daemonSuite.TestUntrustedAccessUntrustedOKWithUser	0.010s
PASS: daemon_test.go:310: daemonSuite.TestUserAccess	0.012s
PASS: response_test.go:121: responseSuite.TestErrorResponderDoesNotPrintfAlways	0.000s
PASS: response_test.go:106: responseSuite.TestErrorResponderPrintfsWithArgs	0.000s
PASS: response_test.go:78: responseSuite.TestFileResponseSetsContentDisposition	0.005s
PASS: response_test.go:63: responseSuite.TestRespDoesNotSetLocationIfOther	0.000s
PASS: response_test.go:99: responseSuite.TestRespJSONWithNullResult	0.000s
PASS: response_test.go:33: responseSuite.TestRespSetsLocationIfAccepted	0.000s
PASS: response_test.go:48: responseSuite.TestRespSetsLocationIfCreated	0.000s
PASS: ucrednet_test.go:49: ucrednetSuite.TestAcceptConnRemoteAddrString	0.001s
PASS: ucrednet_test.go:105: ucrednetSuite.TestAcceptErrors	0.000s
PASS: ucrednet_test.go:182: ucrednetSuite.TestGet	0.000s
PASS: ucrednet_test.go:161: ucrednetSuite.TestGetBadUid	0.000s
PASS: ucrednet_test.go:154: ucrednetSuite.TestGetNoUid	0.000s
PASS: ucrednet_test.go:168: ucrednetSuite.TestGetNonUcrednet	0.000s
PASS: ucrednet_test.go:175: ucrednetSuite.TestGetNothing	0.000s
PASS: ucrednet_test.go:190: ucrednetSuite.TestGetSneak	0.000s
PASS: ucrednet_test.go:198: ucrednetSuite.TestGetWithZeroPid	0.000s
PASS: ucrednet_test.go:141: ucrednetSuite.TestIdempotentClose	0.000s
PASS: ucrednet_test.go:78: ucrednetSuite.TestNonUnix	0.001s
PASS: ucrednet_test.go:120: ucrednetSuite.TestUcredErrors	0.001s
OK: 156 passed, 4 skipped
--- PASS: Test (4.09s)
PASS
ok  	github.com/canonical/pebble/internals/daemon	4.098s
@benhoyt
Copy link
Contributor

benhoyt commented Jul 28, 2023

I'm not sure this is desired. In general we don't want to be running all the tests as root. There are some very specific tests we run as root to test user/group/permissions features, but it's not a good idea (and may be unsafe?) to run all tests as root. Thoughts?

@benhoyt
Copy link
Contributor

benhoyt commented Aug 1, 2023

@shayancanonical Ping on the above.

@shayancanonical
Copy link
Contributor Author

shayancanonical commented Aug 1, 2023

@benhoyt I agree, I wonder if it might be a good idea to skip tests that need to be run as non-root when the executing user is root?

Similar to https://github.com/canonical/pebble/blob/master/internals/daemon/api_files_test.go#L537-L539 (except we would skip the tests if os.Getuid == 0)

@benhoyt
Copy link
Contributor

benhoyt commented Aug 1, 2023

I'd be happy with a tweak like that (though I don't feel it's particularly needed). Feel free to add a PR, or tack it on to #262 if you want.

@benhoyt
Copy link
Contributor

benhoyt commented Aug 8, 2023

Fixed by #262

@benhoyt benhoyt closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants