1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 | $ sudo snap install lxd
# if the group doesn't exist
$ sudo adduser --system lxd --home /var/lib/lxd/ --shell /bin/false
$ sudo adduser $USER lxd
$ newgrp lxd
$ sudo lxd init
# May want to:
$ alias lxc="lxd.lxc"
# As go development env:
$ lxc launch ubuntu:16.04 sd
$ lxc exec sd -- sudo -H -u ubuntu -i
Then follow snapd HACKING.md
Then in the container:
$ cd ~/gocode/src/github.com/snapcore/snapd
$ ubuntu@sd:~/gocode/src/github.com/snapcore/snapd$ ./run-checks
Installing govendor
Obtaining dependencies
Checking docs
Checking formatting
Running vet
Installing govendor
Obtaining dependencies
Building
warning: "github.com/snapcore/snapd/..." matched no packages
warning: "github.com/snapcore/snapd/..." matched no packages
Running tests from /home/ubuntu/gocode/src/github.com/snapcore/snapd
=== RUN Test
OK: 3 passed
--- PASS: Test (0.00s)
PASS
coverage: 90.9% of statements
ok github.com/snapcore/snapd/arch 0.002s
=== RUN Test
OK: 248 passed
--- PASS: Test (1.66s)
PASS
coverage: 91.7% of statements
ok github.com/snapcore/snapd/asserts 1.769s
=== RUN TestAssertsTest
OK: 3 passed
--- PASS: TestAssertsTest (0.08s)
PASS
coverage: 65.7% of statements
ok github.com/snapcore/snapd/asserts/assertstest 0.081s
=== RUN TestSigntool
OK: 3 passed
--- PASS: TestSigntool (0.01s)
PASS
coverage: 96.3% of statements
ok github.com/snapcore/snapd/asserts/signtool 0.017s
=== RUN TestSnapasserts
OK: 7 passed
--- PASS: TestSnapasserts (0.34s)
PASS
coverage: 82.2% of statements
ok github.com/snapcore/snapd/asserts/snapasserts 0.350s
=== RUN TestSysDB
OK: 5 passed
--- PASS: TestSysDB (0.08s)
PASS
coverage: 90.0% of statements
ok github.com/snapcore/snapd/asserts/sysdb 0.083s
? github.com/snapcore/snapd/asserts/systestkeys [no test files]
=== RUN TestBoot
OK: 7 passed
--- PASS: TestBoot (0.07s)
PASS
coverage: 75.3% of statements
ok github.com/snapcore/snapd/boot 0.077s
? github.com/snapcore/snapd/boot/boottest [no test files]
=== RUN Test
----------------------------------------------------------------------
FAIL: login_test.go:34: clientSuite.TestClientLogin
login_test.go:47:
c.Check(err, check.IsNil)
... value *errors.errorString = &errors.errorString{s:"cannot persist login information: chown /tmp/check-6000942797558713415/83/json.PpcVbWsTyRRr: operation not permitted"} ("cannot persist login information: chown /tmp/check-6000942797558713415/83/json.PpcVbWsTyRRr: operation not permitted")
login_test.go:51:
c.Check(user, check.DeepEquals, &client.User{
Username: "the-user-name",
Macaroon: "the-root-macaroon",
Discharges: []string{"discharge-macaroon"}})
... obtained *client.User = (*client.User)(nil)
... expected *client.User = &client.User{ID:0, Username:"the-user-name", Email:"", Macaroon:"the-root-macaroon", Discharges:[]string{"discharge-macaroon"}}
login_test.go:53:
c.Assert(cs.cli.LoggedIn(), check.Equals, true)
... obtained bool = false
... expected bool = true
----------------------------------------------------------------------
FAIL: client_test.go:137: clientSuite.TestClientSetsAuthorization
client_test.go:146:
c.Assert(err, IsNil)
... value *os.PathError = &os.PathError{Op:"chown", Path:"/tmp/check-6000942797558713415/136/json.v85vGwt55bvw", Err:0x1} ("chown /tmp/check-6000942797558713415/136/json.v85vGwt55bvw: operation not permitted")
----------------------------------------------------------------------
FAIL: login_test.go:117: clientSuite.TestReadAuthData
login_test.go:127:
c.Assert(err, check.IsNil)
... value *os.PathError = &os.PathError{Op:"chown", Path:"/tmp/check-6000942797558713415/157/json.vm6tNgHS18rF", Err:0x1} ("chown /tmp/check-6000942797558713415/157/json.vm6tNgHS18rF: operation not permitted")
----------------------------------------------------------------------
FAIL: login_test.go:99: clientSuite.TestWriteAuthData
login_test.go:109:
c.Assert(err, check.IsNil)
... value *os.PathError = &os.PathError{Op:"chown", Path:"/tmp/check-6000942797558713415/168/json.pgqHXfrhJwgp", Err:0x1} ("chown /tmp/check-6000942797558713415/168/json.pgqHXfrhJwgp: operation not permitted")
OOPS: 76 passed, 4 FAILED
--- FAIL: Test (0.16s)
FAIL
coverage: 82.7% of statements
exit status 1
FAIL github.com/snapcore/snapd/client 0.165s
Crushing failure and despair.
|