Update golang.org/x/{sys,crypto}

This commit is contained in:
Alexander Neumann
2018-05-07 22:47:39 +02:00
parent abdd59ea1b
commit 2cbdfbf652
132 changed files with 13128 additions and 4754 deletions

View File

@@ -8,6 +8,7 @@ package main
import (
"fmt"
"strings"
"time"
"golang.org/x/sys/windows/svc"
@@ -26,6 +27,7 @@ func (m *myservice) Execute(args []string, r <-chan svc.ChangeRequest, changes c
slowtick := time.Tick(2 * time.Second)
tick := fasttick
changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}
elog.Info(1, strings.Join(args, "-"))
loop:
for {
select {

View File

@@ -7,10 +7,13 @@
package svc_test
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
@@ -86,8 +89,10 @@ func TestExample(t *testing.T) {
}
defer s.Close()
args := []string{"is", "manual-started", fmt.Sprintf("%d", rand.Int())}
testState(t, s, svc.Stopped)
err = s.Start("is", "manual-started")
err = s.Start(args...)
if err != nil {
t.Fatalf("Start(%s) failed: %s", s.Name, err)
}
@@ -115,4 +120,16 @@ func TestExample(t *testing.T) {
if err != nil {
t.Fatalf("Delete failed: %s", err)
}
cmd := `Get-Eventlog -LogName Application -Newest 100` +
` | Where Source -eq "myservice"` +
` | Select -first 10` +
` | Format-table -HideTableHeaders -property ReplacementStrings`
out, err := exec.Command("powershell", "-Command", cmd).CombinedOutput()
if err != nil {
t.Fatalf("powershell failed: %v\n%v", err, string(out))
}
if want := strings.Join(append([]string{name}, args...), "-"); !strings.Contains(string(out), want) {
t.Errorf("%q string does not contain %q", string(out), want)
}
}

View File

@@ -7,7 +7,7 @@
// func servicemain(argc uint32, argv **uint16)
TEXT ·servicemain(SB),7,$0
MOVL CX, ·sArgc(SB)
MOVL DX, ·sArgv(SB)
MOVQ DX, ·sArgv(SB)
SUBQ $32, SP // stack for the first 4 syscall params