Merge lp:~sergiusens/snapweb/avahi into lp:~snappy-dev/snapweb/trunk

Proposed by Sergio Schvezov on 2015-05-07
Status: Merged
Approved by: Sergio Schvezov on 2015-05-07
Approved revision: 140
Merged at revision: 137
Proposed branch: lp:~sergiusens/snapweb/avahi
Merge into: lp:~snappy-dev/snapweb/trunk
Diff against target: 304 lines (+236/-7)
5 files modified
avahi/avahi.go (+121/-0)
avahi/avahi_test.go (+104/-0)
cmd/snappyd/snappyd.go (+4/-2)
dependencies.tsv (+3/-0)
run-checks (+4/-5)
To merge this branch: bzr merge lp:~sergiusens/snapweb/avahi
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve on 2015-05-07
John Lenton 2015-05-07 Approve on 2015-05-07
Review via email: mp+258539@code.launchpad.net

Commit Message

Initial avahi integration

To post a comment you must log in.
John Lenton (chipaca) :
review: Approve
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/davecheney/gmx failed; trying to fetch newer version
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
update github.com/blakesmith/ar failed; trying to fetch newer version
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update launchpad.net/snappy failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
Building

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/webdm
cp -a . $GOPATH/src/launchpad.net/webdm/
cd $GOPATH/src/launchpad.net/webdm

./run-checks
github.com/davecheney/gmx
github.com/miekg/dns
github.com/davecheney/mdns
launchpad.net/webdm/avahi
gopkg.in/yaml.v2
launchpad.net/webdm/oem
github.com/gorilla/context
github.com/gorilla/mux
github.com/mvo5/goconfigparser
github.com/blakesmith/ar
launchpad.net/snappy/helpers
launchpad.net/snappy/clickdeb
launchpad.net/snappy/coreconfig
github.com/juju/loggo
launchpad.net/snappy/logger
launchpad.net/snappy/partition
launchpad.net/snappy/policy
github.com/cheggaaa/pb
launchpad.net/snappy/progress
launchpad.net/snappy/release
launchpad.net/snappy/systemd
launchpad.net/snappy/snappy
launchpad.net/webdm/webprogress
launchpad.net/webdm/snappy
launchpad.net/webdm/cmd/snappyd
# launchpad.net/webdm/cmd/snappyd
/usr/lib/go/pkg/tool/linux_amd64/6l: running gcc failed: Cannot allocate memory

Sergio Schvezov (sergiusens) wrote :

no memory? really?

review: Approve
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (332.9 KiB)

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/davecheney/gmx failed; trying to fetch newer version
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
update github.com/blakesmith/ar failed; trying to fetch newer version
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
Building
Obtaining npm dependencies

> spawn-sync@1.0.6 postinstall /tmp/tmp.PW3azFOfNe/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.PW3azFOfNe/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.PW3azFOfNe/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.PW3azFOfNe/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> ws@0.4.32 install /tmp/tmp.PW3azFOfNe/src/launchpad.net/webdm/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit ...

Snappy Tarmac (snappydevtarmac) wrote :
Download full text (395.9 KiB)

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/davecheney/gmx failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building
Obtaining npm dependencies

> spawn-sync@1.0.6 postinstall /tmp/tmp.Yif4SFsl7l/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.Yif4SFsl7l/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.Yif4SFsl7l/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.Yif4SFsl7l/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> ws@0.4.32 install /tmp/tmp.Yif4SFsl7l/src/launchpad.net/webdm/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit ...

Snappy Tarmac (snappydevtarmac) wrote :
Download full text (286.5 KiB)

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/davecheney/gmx failed; trying to fetch newer version
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
update github.com/blakesmith/ar failed; trying to fetch newer version
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
Building
Obtaining npm dependencies

> spawn-sync@1.0.6 postinstall /tmp/tmp.zeE7hX8QIq/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.zeE7hX8QIq/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.zeE7hX8QIq/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /tmp/tmp.zeE7hX8QIq/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> ws@0.4.32 install /tmp/tmp.zeE7hX8QIq/src/launchpad.net/webdm/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit ...

review: Approve
Snappy Tarmac (snappydevtarmac) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

review: Approve
Snappy Tarmac (snappydevtarmac) wrote :
Download full text (280.1 KiB)

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/davecheney/gmx failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building
Obtaining npm dependencies

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.MVSLRnXs4O/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.MVSLRnXs4O/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.MVSLRnXs4O/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.MVSLRnXs4O/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> ws@0.4.32 install /home/tarmac/tmp/tmp.MVSLRnXs4O/src/launchpad.net/webdm/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node...

Snappy Tarmac (snappydevtarmac) wrote :
Download full text (275.1 KiB)

The attempt to merge lp:~sergiusens/webdm/avahi into lp:webdm failed. Below is the output from the failed tests.

Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/blakesmith/ar failed; trying to fetch newer version
update github.com/cheggaaa/pb failed; trying to fetch newer version
github.com/blakesmith/ar now at c9a977dd0cc1392b023382c7bfa5a22af8d3b730
update github.com/gorilla/context failed; trying to fetch newer version
github.com/cheggaaa/pb now at e8c7cc515bfde3e267957a3b110080ceed51354e
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/gorilla/context now at 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da
update gopkg.in/yaml.v2 failed; trying to fetch newer version
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
update launchpad.net/snappy failed; trying to fetch newer version
gopkg.in/yaml.v2 now at 49c95bdc21843256fb6c4e0d370a05f24a0bf213
update github.com/davecheney/gmx failed; trying to fetch newer version
launchpad.net/snappy now at snappy_tarmac-20150507103214-pgd90adryua6v6wi
update github.com/davecheney/mdns failed; trying to fetch newer version
github.com/davecheney/gmx now at d765420e7fbaccecb2a38cf2a02701fe3e0888a3
update github.com/gorilla/mux failed; trying to fetch newer version
github.com/davecheney/mdns now at de174d86a3d3e87bfad9cb66cedd0433380b67b0
update github.com/juju/loggo failed; trying to fetch newer version
github.com/gorilla/mux now at e444e69cbd2e2e3e0749a2f3c717cec491552bbf
update github.com/miekg/dns failed; trying to fetch newer version
github.com/juju/loggo now at 4c7cbce140ca070eeb59a28f4bf9507e511711f9
update github.com/mvo5/goconfigparser failed; trying to fetch newer version
github.com/miekg/dns now at 5a357a6fc5e85268b929350aa6423e2d56dcc4ff
github.com/mvo5/goconfigparser now at 26426272dda20cc76aa1fa44286dc743d2972fe8
Building
Obtaining npm dependencies

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.IAGqDnv6Vd/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.IAGqDnv6Vd/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.IAGqDnv6Vd/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> spawn-sync@1.0.6 postinstall /home/tarmac/tmp/tmp.IAGqDnv6Vd/src/launchpad.net/webdm/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall

> ws@0.4.32 install /home/tarmac/tmp/tmp.IAGqDnv6Vd/src/launchpad.net/webdm/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node...

lp:~sergiusens/snapweb/avahi updated on 2015-05-07
138. By Sergio Schvezov on 2015-05-07

Merging trunk

139. By Sergio Schvezov on 2015-05-07

Moving npm i && u to later and making it quiet

140. By Sergio Schvezov on 2015-05-07

Fixing the "package comment" error

Sergio Schvezov (sergiusens) wrote :

fixing
http://bazaar.launchpad.net/~sergiusens/webdm/avahi/revision/140
avahi/avahi.go:1:1: package comment should be of the form "Package avahi ..." avahi/avahi.go:1:1: package comment should not have leading space

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'avahi'
2=== added file 'avahi/avahi.go'
3--- avahi/avahi.go 1970-01-01 00:00:00 +0000
4+++ avahi/avahi.go 2015-05-07 23:00:52 +0000
5@@ -0,0 +1,121 @@
6+/*
7+ * Copyright (C) 2014-2015 Canonical Ltd
8+ *
9+ * This program is free software: you can redistribute it and/or modify
10+ * it under the terms of the GNU General Public License version 3 as
11+ * published by the Free Software Foundation.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU General Public License
19+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20+ *
21+ */
22+
23+package avahi
24+
25+import (
26+ "fmt"
27+ "log"
28+ "net"
29+ "os"
30+ "strings"
31+ "sync"
32+ "time"
33+
34+ "github.com/davecheney/mdns"
35+)
36+
37+var logger *log.Logger
38+
39+var initOnce sync.Once
40+
41+const (
42+ hostnameLocalhost = "localhost"
43+ hostnameWedbm = "webdm"
44+)
45+
46+const timeoutMinutes = 10
47+const inAddr = `%s.local. 60 IN A %s`
48+const inPtr = `%s.in-addr.arpa. 60 IN PTR %s.local.`
49+
50+var mdnsPublish = mdns.Publish
51+
52+func tryPublish(hostname, ip string) {
53+ rr := fmt.Sprintf(inAddr, hostname, ip)
54+
55+ logger.Println("Publishing", rr)
56+
57+ if err := mdnsPublish(rr); err != nil {
58+ logger.Printf(`Unable to publish record "%s": %v`, rr, err)
59+ return
60+ }
61+}
62+
63+var netInterfaceAddrs = net.InterfaceAddrs
64+
65+func ipAddrs() (addrs []net.Addr, err error) {
66+ ifaces, err := netInterfaceAddrs()
67+ if err != nil {
68+ return nil, err
69+ }
70+
71+ for _, iface := range ifaces {
72+ addrs = append(addrs, iface)
73+ }
74+
75+ return addrs, nil
76+}
77+
78+// Init initializes the avahi subsystem.
79+func Init(l *log.Logger) {
80+ logger = l
81+
82+ initOnce.Do(timeoutLoop)
83+}
84+
85+func timeoutLoop() {
86+ timeout := time.NewTimer(timeoutMinutes * time.Minute)
87+
88+ for {
89+ loop()
90+ timeout.Reset(timeoutMinutes * time.Minute)
91+ <-timeout.C
92+ }
93+}
94+
95+var osHostname = os.Hostname
96+
97+func loop() {
98+ addrs, err := ipAddrs()
99+ if err != nil {
100+ logger.Println("Cannot obtain IP addresses:", err)
101+ return
102+ }
103+
104+ hostname, err := osHostname()
105+ if err != nil {
106+ logger.Println("Cannot obtain hostname:", err)
107+ return
108+ }
109+
110+ if strings.ContainsRune(hostname, '.') {
111+ hostname = strings.Split(hostname, ".")[0]
112+ }
113+
114+ if hostname == hostnameLocalhost {
115+ hostname = hostnameWedbm
116+ }
117+
118+ for _, ip := range addrs {
119+ ip := strings.Split(ip.String(), "/")[0]
120+ if strings.HasPrefix(ip, "127.") {
121+ continue
122+ }
123+
124+ tryPublish(hostname, ip)
125+ }
126+}
127
128=== added file 'avahi/avahi_test.go'
129--- avahi/avahi_test.go 1970-01-01 00:00:00 +0000
130+++ avahi/avahi_test.go 2015-05-07 23:00:52 +0000
131@@ -0,0 +1,104 @@
132+/*
133+ * Copyright (C) 2014-2015 Canonical Ltd
134+ *
135+ * This program is free software: you can redistribute it and/or modify
136+ * it under the terms of the GNU General Public License version 3 as
137+ * published by the Free Software Foundation.
138+ *
139+ * This program is distributed in the hope that it will be useful,
140+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
141+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142+ * GNU General Public License for more details.
143+ *
144+ * You should have received a copy of the GNU General Public License
145+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
146+ *
147+ */
148+
149+package avahi
150+
151+import (
152+ "io/ioutil"
153+ "log"
154+ "net"
155+ "os"
156+ "testing"
157+
158+ "github.com/davecheney/mdns"
159+ . "gopkg.in/check.v1"
160+)
161+
162+func Test(t *testing.T) { TestingT(t) }
163+
164+type stubAddr struct {
165+ address string
166+}
167+
168+func (a stubAddr) Network() string {
169+ return ""
170+}
171+
172+func (a stubAddr) String() string {
173+ return a.address
174+}
175+
176+type AvahiSuite struct {
177+ publish []string
178+}
179+
180+var _ = Suite(&AvahiSuite{})
181+
182+func (s *AvahiSuite) SetUpTest(c *C) {
183+ logger = log.New(ioutil.Discard, "", 0)
184+
185+ mdnsPublish = func(rr string) error { s.publish = append(s.publish, rr); return nil }
186+ osHostname = func() (string, error) { return "localhost", nil }
187+}
188+
189+func (s *AvahiSuite) TearDownTest(c *C) {
190+ mdnsPublish = mdns.Publish
191+ osHostname = os.Hostname
192+ netInterfaceAddrs = net.InterfaceAddrs
193+ s.publish = nil
194+}
195+
196+func (s *AvahiSuite) TestLoopLocalAddressOnly(c *C) {
197+ netInterfaceAddrs = func() ([]net.Addr, error) {
198+ return []net.Addr{&stubAddr{"127.0.0.1"}}, nil
199+ }
200+
201+ loop()
202+ c.Check(s.publish, HasLen, 0)
203+}
204+
205+func (s *AvahiSuite) TestLoopLocalCNetwork(c *C) {
206+ netInterfaceAddrs = func() ([]net.Addr, error) {
207+ return []net.Addr{&stubAddr{"192.168.1.1"}}, nil
208+ }
209+
210+ loop()
211+ c.Assert(s.publish, HasLen, 1)
212+ c.Assert(s.publish[0], Equals, "webdm.local. 60 IN A 192.168.1.1")
213+}
214+
215+func (s *AvahiSuite) TestLoopLocalCAndv6Network(c *C) {
216+ netInterfaceAddrs = func() ([]net.Addr, error) {
217+ return []net.Addr{&stubAddr{"192.168.1.1"}, &stubAddr{"fe80::5054:ff:fe12:3456"}}, nil
218+ }
219+
220+ loop()
221+ c.Assert(s.publish, HasLen, 2)
222+ c.Assert(s.publish[0], Equals, "webdm.local. 60 IN A 192.168.1.1")
223+ c.Assert(s.publish[1], Equals, "webdm.local. 60 IN A fe80::5054:ff:fe12:3456")
224+}
225+
226+func (s *AvahiSuite) TestLoopLocalCNetworkOtherHostname(c *C) {
227+ osHostname = func() (string, error) { return "other.something", nil }
228+ netInterfaceAddrs = func() ([]net.Addr, error) {
229+ return []net.Addr{&stubAddr{"192.168.1.1"}}, nil
230+ }
231+
232+ loop()
233+ c.Assert(s.publish, HasLen, 1)
234+ c.Assert(s.publish[0], Equals, "other.local. 60 IN A 192.168.1.1")
235+}
236
237=== modified file 'cmd/snappyd/snappyd.go'
238--- cmd/snappyd/snappyd.go 2015-05-03 20:42:50 +0000
239+++ cmd/snappyd/snappyd.go 2015-05-07 23:00:52 +0000
240@@ -21,6 +21,8 @@
241 "log"
242 "net/http"
243 "os"
244+
245+ "launchpad.net/webdm/avahi"
246 )
247
248 var logger *log.Logger
249@@ -32,10 +34,10 @@
250 }
251
252 func main() {
253- logger.Println("Connecting to System Bus")
254-
255 initURLHandlers(logger)
256
257+ go avahi.Init(logger)
258+
259 logger.Println("Snappy starting...")
260
261 if err := http.ListenAndServe(httpAddr, nil); err != nil {
262
263=== modified file 'dependencies.tsv'
264--- dependencies.tsv 2015-05-07 15:41:55 +0000
265+++ dependencies.tsv 2015-05-07 23:00:52 +0000
266@@ -1,8 +1,11 @@
267 github.com/blakesmith/ar git c9a977dd0cc1392b023382c7bfa5a22af8d3b730 2013-02-19T04:59:55Z
268 github.com/cheggaaa/pb git e8c7cc515bfde3e267957a3b110080ceed51354e 2014-12-02T07:01:21Z
269+github.com/davecheney/gmx git d765420e7fbaccecb2a38cf2a02701fe3e0888a3 2014-12-23T12:57:49Z
270+github.com/davecheney/mdns git de174d86a3d3e87bfad9cb66cedd0433380b67b0 2014-09-13T23:56:41Z
271 github.com/gorilla/context git 50c25fb3b2b3b3cc724e9b6ac75fb44b3bccd0da 2014-11-26T16:34:05Z
272 github.com/gorilla/mux git e444e69cbd2e2e3e0749a2f3c717cec491552bbf 2014-09-26T15:38:14Z
273 github.com/juju/loggo git 4c7cbce140ca070eeb59a28f4bf9507e511711f9 2015-02-26T05:51:10Z
274+github.com/miekg/dns git 5a357a6fc5e85268b929350aa6423e2d56dcc4ff 2015-04-18T05:52:30Z
275 github.com/mvo5/goconfigparser git 26426272dda20cc76aa1fa44286dc743d2972fe8 2015-02-12T09:37:50Z
276 gopkg.in/check.v1 git 64131543e7896d5bcc6bd5a76287eb75ea96c673 2014-10-24T13:38:53Z
277 gopkg.in/yaml.v2 git 49c95bdc21843256fb6c4e0d370a05f24a0bf213 2015-02-24T22:57:58Z
278
279=== modified file 'run-checks'
280--- run-checks 2015-05-07 09:29:52 +0000
281+++ run-checks 2015-05-07 23:00:52 +0000
282@@ -33,11 +33,6 @@
283 echo Building
284 go build -v launchpad.net/webdm/...
285
286-# www
287-echo Obtaining npm dependencies
288-npm install && npm update
289-
290-
291 # tests
292 echo Running tests from $(pwd)
293 $goctest -v -cover ./...
294@@ -56,6 +51,10 @@
295 exit 1
296 fi
297
298+# www
299+echo Obtaining npm dependencies
300+npm install --loglevel error && npm update --loglevel error
301+
302 # js unit tests
303 echo "Running js unit tests (set JS_TESTER to override)"
304 ${JS_TESTER:- ./node_modules/karma/bin/karma start --single-run}

Subscribers

People subscribed via source and target branches