Merge lp://qastaging/~mvo/snappy/snappy-verify into lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github

Proposed by Michael Vogt
Status: Work in progress
Proposed branch: lp://qastaging/~mvo/snappy/snappy-verify
Merge into: lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 468 lines (+310/-45)
9 files modified
cmd/snappy/cmd_verify.go (+43/-0)
helpers/helpers.go (+4/-0)
snappy/build.go (+3/-37)
snappy/build_test.go (+1/-3)
snappy/hashes.go (+85/-0)
snappy/hashes_test.go (+65/-0)
snappy/snapp.go (+26/-5)
snappy/verify.go (+48/-0)
snappy/verify_test.go (+35/-0)
To merge this branch: bzr merge lp://qastaging/~mvo/snappy/snappy-verify
Reviewer Review Type Date Requested Status
Leo Arias (community) Needs Fixing
Federico Gimenez (community) continuous-integration Needs Fixing
Snappy Tarmac continuous-integration Pending
Review via email: mp+261718@code.qastaging.launchpad.net

Description of the change

Implement "snappy verify" that will ensure that all files are correct on
disk.

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
Revision history for this message
Leo Arias (elopio) :
509. By Michael Vogt

merged lp:snappy

510. By Michael Vogt

snappy/parts.go: take the easy route and cast to SnapPart in VerifyInstalled

511. By Michael Vogt

snappy/snapp.go: remove RemoteSnapPart.Verify, SystemImagePart.Verify

512. By Michael Vogt

cmd/snappy/cmd_verify.go: improve help message (thanks Leo!)

513. By Michael Vogt

helpers/helpers.go: fix typo in comment (thanks Leo)

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks John and Leo for the review! I addressed the comments now. I will do a followup branch (or some) to address the interface problem, its too big but its hard to change unfortunately.

Revision history for this message
Leo Arias (elopio) wrote :

When I run snappy verify I get this:

Error: panic: interface conversion: snappy.Part is *snappy.SystemImagePart, not *snappy.SnapPart

goroutine 16 [running]:
runtime.panic(0x809060, 0xc2080c4900)
 /usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
launchpad.net/snappy/snappy.VerifyInstalled(0x7f164e41d8d0, 0xcd9c60, 0x0, 0x0)
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/snappy/verify.go:38 +0x249
main.(*cmdVerify).Execute(0xcd9c60, 0xc208000e80, 0x0, 0x1, 0x0, 0x0)
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/cmd/snappy/cmd_verify.go:42 +0x51
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc20804edc0, 0xc20800e010, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/github.com/jessevdk/go-flags/parser.go:241 +0x7cd
github.com/jessevdk/go-flags.(*Parser).Parse(0xc20804edc0, 0x0, 0x0, 0x0, 0x0, 0x0)
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/github.com/jessevdk/go-flags/parser.go:126 +0xb3
main.main()
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/cmd/snappy/main.go:54 +0x32

goroutine 19 [finalizer wait]:
runtime.park(0x422370, 0xcd8f38, 0xcc50e9)
 /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xcd8f38, 0xcc50e9)
 /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
 /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
 /usr/lib/go/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]:
os/signal.loop()
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 21 [chan receive]:
launchpad.net/snappy/partition.func·005()
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/partition/partition.go:270 +0x4e
created by launchpad.net/snappy/partition.setupSignalHandler
 /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/partition/partition.go:275 +0x174

goroutine 17 [syscall]:
runtime.goexit()
 /usr/lib/go/src/pkg/runtime/proc.c:1445

I don't fully understand the interface conversion error and I could be doing something wrong when setting this up, but in case of doubt, I'll leave a needs fixing.

review: Needs Fixing (exploratory tests)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On Wed, Jun 24, 2015 at 11:54:14PM -0000, Leo Arias wrote:
> Review: Needs Fixing exploratory tests
>
> When I run snappy verify I get this:
>
> Error: panic: interface conversion: snappy.Part is *snappy.SystemImagePart, not *snappy.SnapPart

before converting you need to do something like:

if part, ok := s.(*snappy.SnapPart); ok {{
    // operate on part
}

>
> goroutine 16 [running]:
> runtime.panic(0x809060, 0xc2080c4900)
> /usr/lib/go/src/pkg/runtime/panic.c:279 +0xf5
> launchpad.net/snappy/snappy.VerifyInstalled(0x7f164e41d8d0, 0xcd9c60, 0x0, 0x0)
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/snappy/verify.go:38 +0x249
> main.(*cmdVerify).Execute(0xcd9c60, 0xc208000e80, 0x0, 0x1, 0x0, 0x0)
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/cmd/snappy/cmd_verify.go:42 +0x51
> github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc20804edc0, 0xc20800e010, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/github.com/jessevdk/go-flags/parser.go:241 +0x7cd
> github.com/jessevdk/go-flags.(*Parser).Parse(0xc20804edc0, 0x0, 0x0, 0x0, 0x0, 0x0)
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/github.com/jessevdk/go-flags/parser.go:126 +0xb3
> main.main()
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/cmd/snappy/main.go:54 +0x32
>
> goroutine 19 [finalizer wait]:
> runtime.park(0x422370, 0xcd8f38, 0xcc50e9)
> /usr/lib/go/src/pkg/runtime/proc.c:1369 +0x89
> runtime.parkunlock(0xcd8f38, 0xcc50e9)
> /usr/lib/go/src/pkg/runtime/proc.c:1385 +0x3b
> runfinq()
> /usr/lib/go/src/pkg/runtime/mgc0.c:2644 +0xcf
> runtime.goexit()
> /usr/lib/go/src/pkg/runtime/proc.c:1445
>
> goroutine 20 [syscall]:
> os/signal.loop()
> /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
> created by os/signal.init·1
> /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x32
>
> goroutine 21 [chan receive]:
> launchpad.net/snappy/partition.func·005()
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/partition/partition.go:270 +0x4e
> created by launchpad.net/snappy/partition.setupSignalHandler
> /home/elopio/workspace/canonical/snappy/experimental/build-area/ubuntu-snappy-1.2/obj-x86_64-linux-gnu/src/launchpad.net/snappy/partition/partition.go:275 +0x174
>
> goroutine 17 [syscall]:
> runtime.goexit()
> /usr/lib/go/src/pkg/runtime/proc.c:1445
>
> I don't fully understand the interface conversion error and I could be doing something wrong when setting this up, but in case of doubt, I'll leave a needs fixing.
> --
> https://code.launchpad.net/~mvo/snappy/snappy-verify/+merge/261718
> Your team Snappy Developers is subscribed to branch lp:snappy.

514. By Michael Vogt

fix crash when trying to verify a SystemImageSnap

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Leo and Sergio! Sorry for this issue, I fixed it now and added a proper test.

Revision history for this message
Leo Arias (elopio) wrote :

I was trying to add a test for the command, and it fails with:
Error: verify for hello-world failed: file mode mismatch for bin: 020000000775 != 020000000755

The MP with the test is here: https://code.launchpad.net/~elopio/snappy/test-verify/+merge/263318

review: Needs Fixing
Revision history for this message
Federico Gimenez (fgimenez) wrote :

FAILED: Continuous integration, rev:514
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mvo/snappy/snappy-verify/+merge/261718/+edit-commit-message

http://10.55.60.183:8080/job/snappy-rolling-ci/27/
Executed test runs:

Click here to trigger a rebuild:
http://10.55.60.183:8080/job/snappy-rolling-ci/27/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

this has a conflict with trunk.

review: Needs Fixing

Unmerged revisions

514. By Michael Vogt

fix crash when trying to verify a SystemImageSnap

513. By Michael Vogt

helpers/helpers.go: fix typo in comment (thanks Leo)

512. By Michael Vogt

cmd/snappy/cmd_verify.go: improve help message (thanks Leo!)

511. By Michael Vogt

snappy/snapp.go: remove RemoteSnapPart.Verify, SystemImagePart.Verify

510. By Michael Vogt

snappy/parts.go: take the easy route and cast to SnapPart in VerifyInstalled

509. By Michael Vogt

merged lp:snappy

508. By Michael Vogt

improve verify output

507. By Michael Vogt

ensure unpack is faithful to the permissiosn in the tar

506. By Michael Vogt

improve error message

505. By Michael Vogt

implement snappy verify

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches