Skip to content
New issue

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

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

Already on GitHub? # to your account

Different test failure results when build and tested on 1)ppc64le arch with rhel image and 2)ppc64le arch without image #411

Closed
ShalmonTitre1 opened this issue Nov 7, 2022 · 1 comment

Comments

@ShalmonTitre1
Copy link

Output for PPC64le arch:-

[root@117d984401e3 go-systemd]# go test ./...

github.com/coreos/go-systemd/v22/internal/dlopen [github.com/coreos/go-systemd/v22/internal/dlopen.test]

internal/dlopen/dlopen_test.go:54:15: undefined: strlen

github.com/coreos/go-systemd/v22/sdjournal

sdjournal/journal.go:27:11: fatal error: systemd/sd-journal.h: No such file or directory
// #include <systemd/sd-journal.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ok github.com/coreos/go-systemd/v22/activation 2.671s
ok github.com/coreos/go-systemd/v22/daemon 0.008s
--- FAIL: TestNew (0.00s)
dbus_test.go:94: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestStartStopUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestRestartUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestReloadUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestReloadOrRestartUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListUnitsByNames (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListUnitsByPatterns (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListUnitsFiltered (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListUnitFilesByPatterns (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListUnitFiles (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestEnableDisableUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestListJobs (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSystemState (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestGetUnitProperties (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestGetUnitPropertiesRejectsInvalidName (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestGetServiceProperty (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSetUnitProperties (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestStartStopTransientUnitAll (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestStartStopTransientScope (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestKillUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestResetFailedUnit (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestConnJobListener (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestMaskUnmask (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestReload (0.00s)
methods_test.go:39: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSubscriptionSetUnit (0.00s)
subscription_set_test.go:29: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSubscribe (0.00s)
subscription_test.go:27: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSubscribeUnit (0.00s)
subscription_test.go:48: dial unix /run/systemd/private: connect: no such file or directory
--- FAIL: TestSubStateSubscription (0.00s)
subscription_test.go:108: dial unix /run/systemd/private: connect: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1016d5f4]

goroutine 51 [running]:
testing.tRunner.func1.2({0x101a3ba0, 0x10300be0})
/usr/bin/go/src/testing/testing.go:1209 +0x27c
testing.tRunner.func1(0xc000172b60)
/usr/bin/go/src/testing/testing.go:1212 +0x228
panic({0x101a3ba0, 0x10300be0})
/usr/bin/go/src/runtime/panic.go:1038 +0x240
github.com/coreos/go-systemd/v22/dbus.(*Conn).Close(0x0)
/home/tester/go/src/github.com/coreos/go-systemd/dbus/dbus.go:175 +0x24
runtime.Goexit()
/usr/bin/go/src/runtime/panic.go:642 +0x210
testing.(*common).FailNow(0xc000172b60)
/usr/bin/go/src/testing/testing.go:756 +0x54
testing.(*common).Fatal(0xc000172b60, {0xc000127ed0, 0x1, 0x1})
/usr/bin/go/src/testing/testing.go:824 +0x6c
github.com/coreos/go-systemd/v22/dbus.TestSubStateSubscription(0xc000172b60)
/home/tester/go/src/github.com/coreos/go-systemd/dbus/subscription_test.go:108 +0xd8
testing.tRunner(0xc000172b60, 0x101db180)
/usr/bin/go/src/testing/testing.go:1259 +0xf0
created by testing.(*T).Run
/usr/bin/go/src/testing/testing.go:1306 +0x370
FAIL github.com/coreos/go-systemd/v22/dbus 0.036s
--- FAIL: TestImportTar (0.00s)
dbus_test.go:33: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestImportRaw (0.00s)
dbus_test.go:50: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestExportTar (0.00s)
dbus_test.go:67: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestExportRaw (0.00s)
dbus_test.go:88: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestPullTar (0.00s)
dbus_test.go:109: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestPullRaw (0.00s)
dbus_test.go:120: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestListAndCancelTransfers (0.00s)
dbus_test.go:132: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
FAIL
FAIL github.com/coreos/go-systemd/v22/import1 0.004s
FAIL github.com/coreos/go-systemd/v22/internal/dlopen [build failed]
--- FAIL: TestJournalEnabled (0.00s)
journal_test.go:30: journald socket not detected
FAIL
FAIL github.com/coreos/go-systemd/v22/journal 0.039s
--- FAIL: TestNew (0.00s)
dbus_test.go:29: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestListSessions (0.00s)
dbus_test.go:36: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
--- FAIL: TestListUsers (0.00s)
dbus_test.go:65: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory
FAIL
FAIL github.com/coreos/go-systemd/v22/#1 0.007s
--- FAIL: TestMachine (0.01s)
panic: systemd-run failed: "System has not been booted with systemd as init system (PID 1). Can't operate.\nFailed to create bus connection: Host is down\n" [recovered]
panic: systemd-run failed: "System has not been booted with systemd as init system (PID 1). Can't operate.\nFailed to create bus connection: Host is down\n"

goroutine 6 [running]:
testing.tRunner.func1.2({0x1018dae0, 0xc0000a0000})
/usr/bin/go/src/testing/testing.go:1209 +0x27c
testing.tRunner.func1(0xc00010eb60)
/usr/bin/go/src/testing/testing.go:1212 +0x228
panic({0x1018dae0, 0xc0000a0000})
/usr/bin/go/src/runtime/panic.go:1038 +0x240
github.com/coreos/go-systemd/v22/machine1.mustCreateTestProcess({0xc000132080, 0x1f})
/home/tester/go/src/github.com/coreos/go-systemd/machine1/dbus_test.go:49 +0x380
github.com/coreos/go-systemd/v22/machine1.TestMachine(0xc00010eb60)
/home/tester/go/src/github.com/coreos/go-systemd/machine1/dbus_test.go:72 +0x23c
testing.tRunner(0xc00010eb60, 0x101c6c00)
/usr/bin/go/src/testing/testing.go:1259 +0xf0
created by testing.(*T).Run
/usr/bin/go/src/testing/testing.go:1306 +0x370
FAIL github.com/coreos/go-systemd/v22/machine1 0.017s
FAIL github.com/coreos/go-systemd/v22/sdjournal [build failed]
ok github.com/coreos/go-systemd/v22/unit 0.003s
ok github.com/coreos/go-systemd/v22/util 0.003s
FAIL

Output for ppc64le arch without running on rhel:-

[user5@minikube go-systemd]$ sudo go test ./... -v

github.com/coreos/go-systemd/v22/internal/dlopen [github.com/coreos/go-systemd/v22/internal/dlopen.test]

internal/dlopen/dlopen_test.go:54:15: undefined: strlen
=== RUN TestActivation
--- PASS: TestActivation (1.24s)
=== RUN TestActivationNoFix
--- PASS: TestActivationNoFix (0.85s)
=== RUN TestActivationNoFiles
--- PASS: TestActivationNoFiles (0.77s)
=== RUN TestListeners
--- PASS: TestListeners (0.84s)
=== RUN TestPacketConns
--- PASS: TestPacketConns (0.86s)
PASS
ok github.com/coreos/go-systemd/v22/activation 4.576s
=== RUN TestSdNotify
--- PASS: TestSdNotify (0.00s)
=== RUN TestSdWatchdogEnabled
--- PASS: TestSdWatchdogEnabled (0.00s)
PASS
ok github.com/coreos/go-systemd/v22/daemon 0.012s
=== RUN TestNeedsEscape
--- PASS: TestNeedsEscape (0.00s)
=== RUN TestPathBusEscape
--- PASS: TestPathBusEscape (0.00s)
=== RUN TestPathBusUnescape
--- PASS: TestPathBusUnescape (0.00s)
=== RUN TestNew
--- PASS: TestNew (0.00s)
=== RUN TestStartStopUnit
--- PASS: TestStartStopUnit (0.07s)
=== RUN TestRestartUnit
--- PASS: TestRestartUnit (0.06s)
=== RUN TestReloadUnit
--- PASS: TestReloadUnit (1.02s)
=== RUN TestReloadOrRestartUnit
--- PASS: TestReloadOrRestartUnit (0.07s)
=== RUN TestListUnitsByNames
--- PASS: TestListUnitsByNames (0.00s)
=== RUN TestListUnitsByPatterns
--- PASS: TestListUnitsByPatterns (0.01s)
=== RUN TestListUnitsFiltered
--- PASS: TestListUnitsFiltered (0.02s)
=== RUN TestListUnitFilesByPatterns
--- PASS: TestListUnitFilesByPatterns (0.04s)
=== RUN TestListUnitFiles
--- PASS: TestListUnitFiles (1.08s)
=== RUN TestEnableDisableUnit
--- PASS: TestEnableDisableUnit (0.01s)
=== RUN TestListJobs
--- PASS: TestListJobs (0.02s)
=== RUN TestSystemState
--- PASS: TestSystemState (0.00s)
=== RUN TestGetUnitProperties
--- PASS: TestGetUnitProperties (0.01s)
=== RUN TestGetUnitPropertiesRejectsInvalidName
--- PASS: TestGetUnitPropertiesRejectsInvalidName (0.00s)
=== RUN TestGetServiceProperty
--- PASS: TestGetServiceProperty (0.00s)
=== RUN TestSetUnitProperties
--- PASS: TestSetUnitProperties (0.01s)
=== RUN TestStartStopTransientUnitAll
--- PASS: TestStartStopTransientUnitAll (0.41s)
=== RUN TestStartStopTransientScope
--- PASS: TestStartStopTransientScope (0.02s)
=== RUN TestKillUnit
--- PASS: TestKillUnit (0.03s)
=== RUN TestResetFailedUnit
--- PASS: TestResetFailedUnit (0.04s)
=== RUN TestConnJobListener
--- PASS: TestConnJobListener (0.02s)
=== RUN TestMaskUnmask
--- PASS: TestMaskUnmask (0.01s)
=== RUN TestReload
--- PASS: TestReload (0.36s)
=== RUN TestUnitName
--- PASS: TestUnitName (0.00s)
=== RUN TestBasicSetActions
--- PASS: TestBasicSetActions (0.00s)
=== RUN TestSubscriptionSetUnit
--- PASS: TestSubscriptionSetUnit (1.02s)
=== RUN TestSubscribe
--- PASS: TestSubscribe (0.00s)
=== RUN TestSubscribeUnit
--- PASS: TestSubscribeUnit (1.02s)
=== RUN TestSubStateSubscription
--- PASS: TestSubStateSubscription (0.02s)
=== RUN TestPropertiesSubscription
--- PASS: TestPropertiesSubscription (0.02s)
PASS
ok github.com/coreos/go-systemd/v22/dbus 5.384s
=== RUN TestImportTar
dbus_test.go:43: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestImportTar (0.00s)
=== RUN TestImportRaw
dbus_test.go:60: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestImportRaw (0.00s)
=== RUN TestExportTar
dbus_test.go:81: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestExportTar (0.00s)
=== RUN TestExportRaw
dbus_test.go:102: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestExportRaw (0.00s)
=== RUN TestPullTar
dbus_test.go:114: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestPullTar (0.00s)
=== RUN TestPullRaw
dbus_test.go:125: The name org.freedesktop.import1 was not provided by any .service files
--- FAIL: TestPullRaw (0.08s)
=== RUN TestListAndCancelTransfers
dbus_test.go:142: The name org.freedesktop.import1 was not provided by any .service files
dbus_test.go:145: transfers length is not correct
--- FAIL: TestListAndCancelTransfers (0.00s)
FAIL
FAIL github.com/coreos/go-systemd/v22/import1 0.097s
FAIL github.com/coreos/go-systemd/v22/internal/dlopen [build failed]
=== RUN TestJournalEnabled
--- PASS: TestJournalEnabled (0.00s)
=== RUN TestValidVarName
--- PASS: TestValidVarName (0.00s)
=== RUN TestJournalSend
journal_test.go:104: journal send test #0 - empty message (len=0)
journal_test.go:104: journal send test #1 - small message (len=5)
journal_test.go:104: journal send test #2 - large message (len=229377)
journal_test.go:104: journal send test #3 - huge message (len=1234567890)
--- PASS: TestJournalSend (3.30s)
PASS
ok github.com/coreos/go-systemd/v22/journal 3.394s
=== RUN TestNew
--- PASS: TestNew (0.00s)
=== RUN TestListSessions
dbus_test.go:56: invalid session path: /org/freedesktop/#1/session/c1
--- FAIL: TestListSessions (0.01s)
=== RUN TestListUsers
--- PASS: TestListUsers (0.00s)
FAIL
FAIL github.com/coreos/go-systemd/v22/#1 0.014s
=== RUN TestMachine
dbus_test.go:85: The name org.freedesktop.machine1 was not provided by any .service files
--- FAIL: TestMachine (0.12s)
=== RUN TestImages
dbus_test.go:163: open /var/lib/machines/machined-test-ahdimtth: no such file or directory
--- FAIL: TestImages (0.00s)
FAIL
FAIL github.com/coreos/go-systemd/v22/machine1 0.124s
=== RUN TestGetFunction
--- PASS: TestGetFunction (0.00s)
=== RUN TestJournalFollow
--- PASS: TestJournalFollow (5.04s)
=== RUN TestJournalWait
--- PASS: TestJournalWait (1.73s)
=== RUN TestJournalGetUsage
--- PASS: TestJournalGetUsage (0.00s)
=== RUN TestJournalCursorGetSeekAndTest
--- PASS: TestJournalCursorGetSeekAndTest (0.60s)
=== RUN TestNewJournalFromDir
--- PASS: TestNewJournalFromDir (0.00s)
=== RUN TestJournalGetData
--- PASS: TestJournalGetData (1.00s)
=== RUN TestJournalGetEntry
--- PASS: TestJournalGetEntry (1.00s)
=== RUN TestJournalReaderSmallReadBuffer
--- PASS: TestJournalReaderSmallReadBuffer (1.01s)
=== RUN TestJournalGetUniqueValues
--- PASS: TestJournalGetUniqueValues (0.50s)
=== RUN TestJournalGetCatalog
journal_test.go:457: Error reading to journal: EOF
--- FAIL: TestJournalGetCatalog (0.00s)
=== RUN TestJournalGetBootID
Test GetBootID: 66e243e5fafe4762ba09afb3507bea77--- PASS: TestJournalGetBootID (0.00s)
FAIL
FAIL github.com/coreos/go-systemd/v22/sdjournal 10.889s
=== RUN TestDeserialize
--- PASS: TestDeserialize (0.00s)
=== RUN TestDeserializeSections
--- PASS: TestDeserializeSections (0.00s)
=== RUN TestDeserializeFail
--- PASS: TestDeserializeFail (0.00s)
=== RUN TestDeserializeLineTooLong
--- PASS: TestDeserializeLineTooLong (0.00s)
=== RUN TestDeserializeAndReserialize
--- PASS: TestDeserializeAndReserialize (0.00s)
=== RUN TestUnitNameEscape
--- PASS: TestUnitNameEscape (0.00s)
=== RUN TestUnitNameUnescape
--- PASS: TestUnitNameUnescape (0.00s)
=== RUN TestAllMatch
--- PASS: TestAllMatch (0.00s)
=== RUN TestMatch
--- PASS: TestMatch (0.00s)
=== RUN TestSerialize
--- PASS: TestSerialize (0.00s)
=== RUN TestSerializeSection
--- PASS: TestSerializeSection (0.00s)
PASS
ok github.com/coreos/go-systemd/v22/unit 0.004s
=== RUN TestRunningFromSystemService
=== PAUSE TestRunningFromSystemService
=== RUN TestCurrentUnitName
util_test.go:45: Not running from a systemd service
--- SKIP: TestCurrentUnitName (0.00s)
=== RUN TestGetMachineID
--- PASS: TestGetMachineID (0.00s)
=== RUN TestGetRunningSlice
--- PASS: TestGetRunningSlice (0.00s)
=== CONT TestRunningFromSystemService
--- PASS: TestRunningFromSystemService (0.00s)
PASS
ok github.com/coreos/go-systemd/v22/util 0.009s
FAIL

Can anyone suggest me on how to resolve following erros when running package inside container.

@lucab
Copy link
Contributor

lucab commented Nov 7, 2022

Thanks for the report.
The dlopen issue is test mixup, #412 is up to fix it.

The rest of the issues are due to missing development headers (error: systemd/sd-journal.h: No such file or directory) and not running the test on a systemd-booted machine (System has not been booted with systemd as init system (PID 1)).

Please note that this isn't a support channel, make sure your local environment is fine first and please open tickets here if you observe a bug. Thanks!

@lucab lucab closed this as completed Nov 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants