19 Commits

Author SHA1 Message Date
Michael Stapelberg
0daf1b1ae4 packer: stop using tlsflag global state 2025-12-08 21:32:59 +01:00
Michael Stapelberg
9e3ab11076 packer: add test for losing HTTPS certificates
related to https://github.com/gokrazy/tools/pull/68
2025-12-06 08:49:22 +01:00
Michael Stapelberg
dc8c88b368 gokupdate_test: refactor to use readConfig/writeConfig 2025-12-05 08:36:19 +01:00
Michael Stapelberg
91c487c959 packer: use HTTPS client despite -insecure (post-update) (+test)
While adding the integration test for
https://gokrazy.org/userguide/tls-for-untrusted-networks/,
I noticed that the packer does not actually successfully complete
the initial HTTPS deployment (where -insecure is used).
After writing the image to disk and rebooting, the packer was stuck at:

device not yet reachable: Get "https://localhost:9080/": http:
server gave HTTP response to HTTPS client

related to https://github.com/gokrazy/tools/pull/94
2025-11-29 12:39:22 +01:00
Michael Stapelberg
d1929f390f integration: enable QEMU hardware acceleration 2025-11-29 11:24:47 +01:00
Michael Stapelberg
2c805ed001 refactor cobra command initialization to avoid stale state
Before this commit, we held onto *cobra.Command objects,
but that is not actually supported: after the first Execute(),
commands like updateCmd are stuck on the first-ever provided ctx.

Instead, turn command initialization into functions.

I only noticed this when trying to do two 'gok update'
from within the same test, where the fake build timestamp
is injected via the context (the timestamp was always the same).
2025-11-29 10:47:48 +01:00
Michael Stapelberg
d588a72286 integration: start QEMU VM for 'gok update' test
related to https://github.com/gokrazy/tools/pull/94
2025-11-29 09:56:11 +01:00
Michael Stapelberg
9a9519186b integration: add 'gok update' test
Some checks failed
gokrazy CI / CI (macos-latest) (push) Has been cancelled
gokrazy CI / CI (ubuntu-latest) (push) Has been cancelled
gokrazy CI / CI (windows-latest) (push) Has been cancelled
2025-10-03 19:12:17 +02:00
Michael Stapelberg
ab29b81133 tests: use t.Chdir now that we are on Go 1.24 2025-10-03 18:32:43 +02:00
Michael Stapelberg
c3e6903b57 fix gokrun_test on macOS 2025-02-21 21:29:05 +01:00
Michael Stapelberg
9e9952330e delete now-obsolete gokrpacker_test, too
related to https://github.com/gokrazy/gokrazy/issues/301
2025-02-21 20:18:56 +01:00
Michael Stapelberg
703a860502 sbom: do not hash source files, record buildid of binaries instead
Before this commit, the mere presence of files with certain names in local
package directories would make the build fail (see nonmodulefiles_test.go).

With this commit, we now record the buildinfo and buildid of all built Go
programs of this gokrazy instance.

related to https://github.com/gokrazy/gokrazy/issues/297

fixes https://github.com/gokrazy/gokrazy/issues/299
2025-02-21 18:51:16 +01:00
Michael Stapelberg
5762235ac5 make ExtraFilePaths absolute earlier to fix sbom in relative parents
fixes https://github.com/gokrazy/gokrazy/issues/289
2025-01-22 21:49:32 +01:00
Michael Stapelberg
ea613267ff gok new: use relative path for breakglass.authorized_keys
related to https://github.com/gokrazy/gokrazy/issues/289
2025-01-22 21:41:48 +01:00
oliverpool
e53ba4e609 Satisfy staticcheck (#74)
* remove deprecated ioutil usage

* use more suitable functions

* add missing error handling

* remove unused variables

* select{} instead of for{}
2024-07-04 17:35:15 +02:00
Michael Stapelberg
ce2433aa1a gok: move code to internal/gok 2023-01-29 19:30:23 +01:00
Michael Stapelberg
c61213349c provide a programmatic entry point to the gok CLI
This interfaces with spf13/cobra without typing ourselves to its types, and
exerting control (for better of for worse) about what aspects one can control.

With this, we can move the code in cmd to internal/
2023-01-15 15:55:51 +01:00
Michael Stapelberg
7d22eb8e32 add integration test for gokr-packer and its migration path 2023-01-07 16:16:46 +01:00
Michael Stapelberg
edb2616fdb integration test for gok run 2022-09-13 19:27:13 +02:00