Skip to content

Commit 9b6e537

Browse files
authored
Merge branch 'golang:master' into windows_mkwinsyscall_ext
2 parents a428f66 + a1a9c4b commit 9b6e537

24 files changed

+155
-28
lines changed

unix/linux/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515
# Get the git sources. If not cached, this takes O(5 minutes).
1616
WORKDIR /git
1717
RUN git config --global advice.detachedHead false
18-
# Linux Kernel: Released 23 Apr 2023
19-
RUN git clone --branch v6.3 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
20-
# GNU C library: Released 1 Feb 2022
18+
# Linux Kernel: Released 25 June 2023
19+
RUN git clone --branch v6.4 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
20+
# GNU C library: Released 1 Feb 2023
2121
RUN git clone --branch release/2.37/master --depth 1 https://sourceware.org/git/glibc.git
2222

2323
# Get Go
24-
ENV GOLANG_VERSION 1.20.5
24+
ENV GOLANG_VERSION 1.21rc2
2525
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
26-
ENV GOLANG_DOWNLOAD_SHA256 d7ec48cde0d3d2be2c69203bc3e0a44de8660b9c09a6e85c4732a3f7dc442612
26+
ENV GOLANG_DOWNLOAD_SHA256 8fe90332727c606019e80a7368e23f5e65ad59520e45ee4010692f15572e45c6
2727

2828
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
2929
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \

unix/linux/types.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5721,6 +5721,8 @@ const (
57215721
TUN_F_TSO6 = C.TUN_F_TSO6
57225722
TUN_F_TSO_ECN = C.TUN_F_TSO_ECN
57235723
TUN_F_UFO = C.TUN_F_UFO
5724+
TUN_F_USO4 = C.TUN_F_USO4
5725+
TUN_F_USO6 = C.TUN_F_USO6
57245726
)
57255727

57265728
// generated by:
@@ -5734,9 +5736,10 @@ const (
57345736
// generated by:
57355737
// perl -nlE '/^#define (VIRTIO_NET_HDR_GSO_\w+)/ && say "$1 = C.$1"' include/uapi/linux/virtio_net.h
57365738
const (
5737-
VIRTIO_NET_HDR_GSO_NONE = C.VIRTIO_NET_HDR_GSO_NONE
5738-
VIRTIO_NET_HDR_GSO_TCPV4 = C.VIRTIO_NET_HDR_GSO_TCPV4
5739-
VIRTIO_NET_HDR_GSO_UDP = C.VIRTIO_NET_HDR_GSO_UDP
5740-
VIRTIO_NET_HDR_GSO_TCPV6 = C.VIRTIO_NET_HDR_GSO_TCPV6
5741-
VIRTIO_NET_HDR_GSO_ECN = C.VIRTIO_NET_HDR_GSO_ECN
5739+
VIRTIO_NET_HDR_GSO_NONE = C.VIRTIO_NET_HDR_GSO_NONE
5740+
VIRTIO_NET_HDR_GSO_TCPV4 = C.VIRTIO_NET_HDR_GSO_TCPV4
5741+
VIRTIO_NET_HDR_GSO_UDP = C.VIRTIO_NET_HDR_GSO_UDP
5742+
VIRTIO_NET_HDR_GSO_TCPV6 = C.VIRTIO_NET_HDR_GSO_TCPV6
5743+
VIRTIO_NET_HDR_GSO_UDP_L4 = C.VIRTIO_NET_HDR_GSO_UDP_L4
5744+
VIRTIO_NET_HDR_GSO_ECN = C.VIRTIO_NET_HDR_GSO_ECN
57425745
)

unix/zerrors_linux.go

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/zsysnum_linux_s390x.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux.go

Lines changed: 12 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_386.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_amd64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_arm.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_arm64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_loong64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_mips.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_mips64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_mips64le.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_mipsle.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_ppc.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_ppc64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_ppc64le.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_riscv64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_s390x.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux_sparc64.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

windows/service.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ type SERVICE_FAILURE_ACTIONS struct {
218218
Actions *SC_ACTION
219219
}
220220

221+
type SERVICE_FAILURE_ACTIONS_FLAG struct {
222+
FailureActionsOnNonCrashFailures int32
223+
}
224+
221225
type SC_ACTION struct {
222226
Type uint32
223227
Delay uint32

windows/svc/mgr/mgr_test.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,57 @@ func testRecoveryCommand(t *testing.T, s *mgr.Service, should string) {
209209
}
210210
}
211211

212+
func testRecoveryActionsOnNonCrashFailures(t *testing.T, s *mgr.Service, should bool) {
213+
err := s.SetRecoveryActionsOnNonCrashFailures(should)
214+
if err != nil {
215+
t.Fatalf("SetRecoveryActionsOnNonCrashFailures failed: %v", err)
216+
}
217+
is, err := s.RecoveryActionsOnNonCrashFailures()
218+
if err != nil {
219+
t.Fatalf("RecoveryActionsOnNonCrashFailures failed: %v", err)
220+
}
221+
if should != is {
222+
t.Errorf("RecoveryActionsOnNonCrashFailures mismatch: flag is %v, but should have %v", is, should)
223+
}
224+
}
225+
226+
func testMultipleRecoverySettings(t *testing.T, s *mgr.Service, rebootMsgShould, recoveryCmdShould string, actionsFlagShould bool) {
227+
err := s.SetRebootMessage(rebootMsgShould)
228+
if err != nil {
229+
t.Fatalf("SetRebootMessage failed: %v", err)
230+
}
231+
err = s.SetRecoveryActionsOnNonCrashFailures(actionsFlagShould)
232+
if err != nil {
233+
t.Fatalf("SetRecoveryActionsOnNonCrashFailures failed: %v", err)
234+
}
235+
err = s.SetRecoveryCommand(recoveryCmdShould)
236+
if err != nil {
237+
t.Fatalf("SetRecoveryCommand failed: %v", err)
238+
}
239+
240+
rebootMsgIs, err := s.RebootMessage()
241+
if err != nil {
242+
t.Fatalf("RebootMessage failed: %v", err)
243+
}
244+
if rebootMsgShould != rebootMsgIs {
245+
t.Errorf("reboot message mismatch: message is %q, but should have %q", rebootMsgIs, rebootMsgShould)
246+
}
247+
recoveryCommandIs, err := s.RecoveryCommand()
248+
if err != nil {
249+
t.Fatalf("RecoveryCommand failed: %v", err)
250+
}
251+
if recoveryCmdShould != recoveryCommandIs {
252+
t.Errorf("recovery command mismatch: command is %q, but should have %q", recoveryCommandIs, recoveryCmdShould)
253+
}
254+
actionsFlagIs, err := s.RecoveryActionsOnNonCrashFailures()
255+
if err != nil {
256+
t.Fatalf("RecoveryActionsOnNonCrashFailures failed: %v", err)
257+
}
258+
if actionsFlagShould != actionsFlagIs {
259+
t.Errorf("RecoveryActionsOnNonCrashFailures mismatch: flag is %v, but should have %v", actionsFlagIs, actionsFlagShould)
260+
}
261+
}
262+
212263
func testControl(t *testing.T, s *mgr.Service, c svc.Cmd, expectedErr error, expectedStatus svc.Status) {
213264
status, err := s.Control(c)
214265
if err != expectedErr {
@@ -305,6 +356,9 @@ func TestMyService(t *testing.T) {
305356
testRebootMessage(t, s, "") // delete reboot message
306357
testRecoveryCommand(t, s, fmt.Sprintf("sc query %s", name))
307358
testRecoveryCommand(t, s, "") // delete recovery command
359+
testRecoveryActionsOnNonCrashFailures(t, s, true)
360+
testRecoveryActionsOnNonCrashFailures(t, s, false)
361+
testMultipleRecoverySettings(t, s, fmt.Sprintf("%s failed", name), fmt.Sprintf("sc query %s", name), true)
308362

309363
expectedStatus := svc.Status{
310364
State: svc.Stopped,

0 commit comments

Comments
 (0)