Feature #5560

Automatically test that udev-watchdog is monitoring the right device when started from DVD

Added by Tails 2013-07-18 07:42:47 . Updated 2015-08-11 10:46:00 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Test suite
Target version:
Start date:
Due date:
2016-01-15
% Done:

100%

Feature Branch:
kytv:test/5560-udev-watchdog
Type of work:
Code
Blueprint:

Starter:
0
Affected tool:
Deliverable for:
268

Description

In erase_memory.feature we just check that the udev-watchdog process is running. We should also check that it monitors the boot device.


Subtasks


Related issues

Related to Tails - Feature #6106: test suite: erase memory feature Resolved
Related to Tails - Feature #9890: Automatically test that udev-watchdog is monitoring the right device when started from USB Resolved 2015-08-04

History

#1 Updated by intrigeri 2013-10-04 07:48:40

  • Category set to Test suite
  • Starter set to No

#2 Updated by intrigeri 2014-04-17 10:14:36

  • Subject changed from test suite: udev-watchdog device to Automatically test that udev-watchdog is monitoring the right device

#3 Updated by anonym 2015-01-09 14:04:35

  • Assignee set to kytv
  • Target version set to Tails_1.5

#4 Updated by anonym 2015-01-10 17:18:50

  • blocks #8668 added

#5 Updated by kytv 2015-08-01 12:25:44

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 10

#6 Updated by kytv 2015-08-01 12:40:45

  • Assignee changed from kytv to anonym
  • % Done changed from 10 to 30
  • QA Check set to Ready for QA
  • Feature Branch set to kytv:test/5560-udev-watchdog

#7 Updated by intrigeri 2015-08-02 11:01:55

  • Due date set to 2016-01-15

#8 Updated by intrigeri 2015-08-03 07:41:03

  • Assignee changed from anonym to intrigeri

#9 Updated by intrigeri 2015-08-03 09:15:41

  • Assignee changed from intrigeri to kytv
  • % Done changed from 30 to 40
  • QA Check changed from Ready for QA to Dev Needed

Looks good, except (surprise!) some nitpicking on the implementation:

@vm.execute_successfully('ps -wweo cmd | grep udev-watchdog | grep -v grep').stdout.chomp

I have a few problems with this one:

  • it’s forking to the shell while all of this (except calling ps) could be done in Ruby;
  • the grep regexps are much too loose; e.g. a process called “Iamnotudev-watchdog” would match;
  • it would be good to check that we have exactly one matching line in the end.

Also, the regexp that computes monitored_out is complex enough to be worth documenting. It’s unclear to me:

  • why we have .* in the beginning;
  • what \s\w+ at the end is supposed to match;
  • why this regexp is not anchored to the beginning of the string, ditto to the end.

=> if Ruby supports the “/x” flag for regexps, this would be a great place to use it and add inline comments.

I’ve not tested the branch, but I’m sure you did that massively already, so I’ll only test it once I think the code is OK :)

#10 Updated by kytv 2015-08-03 11:22:49

intrigeri wrote:
> Looks good, except (surprise!) some nitpicking on the implementation:
>
> […]
>
> I have a few problems with this one:
>
> * it’s forking to the shell while all of this (except calling ps) could be done in Ruby;

I do like going to the shell a bit too much, eh? :|

[…]

All of the nitpicking has been addressed but not yet pushed; I’m still testing.

> I’ve not tested the branch, but I’m sure you did that massively already, so I’ll only test it once I think the code is OK :)

Oh yes…as usual there’s been lots (and lots) of testing. :D

#11 Updated by kytv 2015-08-03 11:34:48

  • Assignee changed from kytv to intrigeri
  • QA Check changed from Dev Needed to Ready for QA

I’m now happy with this branch. Please nitpick—or better yet—test ‘n’ merge. :)

#12 Updated by kytv 2015-08-03 11:47:36

  • Assignee changed from intrigeri to kytv
  • QA Check changed from Ready for QA to Dev Needed

#13 Updated by kytv 2015-08-03 13:50:25

  • Assignee changed from kytv to intrigeri
  • QA Check changed from Dev Needed to Ready for QA

I split up the previous commit and force pushed. The changes to review start at 3fe0085.

#14 Updated by intrigeri 2015-08-04 01:32:02

  • related to Feature #9890: Automatically test that udev-watchdog is monitoring the right device when started from USB added

#15 Updated by intrigeri 2015-08-04 01:33:30

  • Subject changed from Automatically test that udev-watchdog is monitoring the right device to Automatically test that udev-watchdog is monitoring the right device when started from DVD

#16 Updated by kytv 2015-08-04 01:45:59

Applied in changeset commit:55b6a4920ebacab37d14ac5e6e081d9cded81b20.

#17 Updated by kytv 2015-08-04 01:45:59

Applied in changeset commit:3fe008516834af959fb6c3af48059d90d05a9ea3.

#18 Updated by kytv 2015-08-04 01:45:59

Applied in changeset commit:8061b2bda2fa920e0bf05582fe197eb96028820c.

#19 Updated by intrigeri 2015-08-04 01:46:00

  • Status changed from In Progress to Fix committed
  • % Done changed from 40 to 100

Applied in changeset commit:0f84ded072b73dafacab5ad04bd882419e5bcf66.

#20 Updated by intrigeri 2015-08-04 01:49:02

  • Assignee deleted (intrigeri)
  • QA Check changed from Ready for QA to Pass

Merged! See Feature #9890 for the missing bits.

#21 Updated by intrigeri 2015-08-04 01:50:46

Also, when automating manual tests, in the future please remove them from the manual test suite. I did that this time in commit:c053fbd.

#22 Updated by intrigeri 2015-08-08 13:48:58

  • Deliverable for set to 268

#23 Updated by BitingBird 2015-08-11 10:46:00

  • Status changed from Fix committed to Resolved