Bug 191191 - [tests] tests/mdconfig/legacy_test fails if /dev/md0 is already attached to the system
Summary: [tests] tests/mdconfig/legacy_test fails if /dev/md0 is already attached to t...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-19 17:42 UTC by Enji Cooper
Modified: 2014-12-05 12:54 UTC (History)
0 users

See Also:
ngie: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2014-06-19 17:42:32 UTC
If I have /dev/md0 already attached to the system and try to run mdconfig/legacy_test, it will fail and leave a bunch of memory disks behind:

% kyua test
legacy_test:main  ->  passed  [0.463s]

1/1 passed (0 failed)
Committed action 12
% mdmfs -s 10m 0 /mnt/
% kyua test
legacy_test:main  ->  failed: 1 tests of 1 failed  [0.368s]

0/1 passed (1 failed)
Committed action 13
% mdconfig -l
md0 md1 md2 md3 md4 md5 md6 md7 md8 md9
% umount /mnt/
% mdconfig -l | sed -e 's,md,,' | xargs -n 1 mdconfig -d -u
% mdconfig -l
% kyua test
legacy_test:main  ->  passed  [0.365s]

1/1 passed (0 failed)
Committed action 14
% mdconfig -l
%
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2014-06-19 22:15:35 UTC
Works now with the work I did converting the testcase from prove to ATF:

% mdmfs -s 10m 0 /mnt/
% kyua test
mdconfig_test:attach_vnode_non_explicit_type  ->  passed  [0.088s]
mdconfig_test:attach_vnode_explicit_type  ->  passed  [0.109s]
mdconfig_test:attach_vnode_smaller_than_file  ->  passed  [0.118s]
mdconfig_test:attach_vnode_larger_than_file  ->  passed  [0.086s]
mdconfig_test:attach_vnode_sector_size  ->  passed  [0.093s]
mdconfig_test:attach_malloc  ->  passed  [0.098s]
mdconfig_test:attach_swap  ->  passed  [0.070s]
mdconfig_test:attach_with_specific_unit_number  ->  passed  [0.067s]

8/8 passed (0 failed)
Committed action 37
% umount /mnt/
% kyua test
mdconfig_test:attach_vnode_non_explicit_type  ->  passed  [0.083s]
mdconfig_test:attach_vnode_explicit_type  ->  passed  [0.085s]
mdconfig_test:attach_vnode_smaller_than_file  ->  passed  [0.076s]
mdconfig_test:attach_vnode_larger_than_file  ->  passed  [0.077s]
mdconfig_test:attach_vnode_sector_size  ->  passed  [0.079s]
mdconfig_test:attach_malloc  ->  passed  [0.070s]
mdconfig_test:attach_swap  ->  passed  [0.069s]
mdconfig_test:attach_with_specific_unit_number  ->  passed  [0.064s]

8/8 passed (0 failed)
Committed action 38
[root@freebsd-10-x64 /usr/tests/sbin/mdconfig]# mdconfig -l
md0
[root@freebsd-10-x64 /usr/tests/sbin/mdconfig]# mdconfig -d -u 0
[root@freebsd-10-x64 /usr/tests/sbin/mdconfig]# kyua test
mdconfig_test:attach_vnode_non_explicit_type  ->  passed  [0.087s]
mdconfig_test:attach_vnode_explicit_type  ->  passed  [0.077s]
mdconfig_test:attach_vnode_smaller_than_file  ->  passed  [0.075s]
mdconfig_test:attach_vnode_larger_than_file  ->  passed  [0.075s]
mdconfig_test:attach_vnode_sector_size  ->  passed  [0.080s]
mdconfig_test:attach_malloc  ->  passed  [0.080s]
mdconfig_test:attach_swap  ->  passed  [0.068s]
mdconfig_test:attach_with_specific_unit_number  ->  passed  [0.080s]

8/8 passed (0 failed)
Committed action 39
% mdconfig -l

I removed some of the implied testcases (the querying sections mostly) because it was already covered in the other sections.

The commit for this change can be found here: https://github.com/yaneurabeya/freebsd/commit/9cc8adcfad852cadb97637cdeddc462a7b7bf33b
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-06-26 02:16:51 UTC
So does this mean this PR can be closed?
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2014-06-26 03:29:55 UTC
(In reply to Mark Linimon from comment #2)
> So does this mean this PR can be closed?

Once the commit from my github branch is reviewed and pulled in to the tree, this could be closed.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-11-27 06:04:44 UTC
A commit references this bug:

Author: ngie
Date: Thu Nov 27 06:04:01 UTC 2014
New revision: 275170
URL: https://svnweb.freebsd.org/changeset/base/275170

Log:
  Convert sbin/mdconfig/tests from prove format tests to ATF format tests

  As a side effect...
  1. The tests now checks for the root user before continuing with kyua, which is
     more visible than the test being skipped with the TAP protocol
  2. The tests work with devices that aren't /dev/md0 by caching the device
     attached during the test to a file, and later use the cached information to
     detach the device in the cleanup routine
  3. The tests no longer require perl to run

  MFC after: 1 week
  PR: 191191
  Sponsored by: EMC / Isilon Storage Division

Changes:
  head/ObsoleteFiles.inc
  head/sbin/mdconfig/tests/Makefile
  head/sbin/mdconfig/tests/legacy_test.sh
  head/sbin/mdconfig/tests/mdconfig.test
  head/sbin/mdconfig/tests/mdconfig_test.sh
  head/sbin/mdconfig/tests/run.pl
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-12-05 12:51:55 UTC
A commit references this bug:

Author: ngie
Date: Fri Dec  5 12:51:28 UTC 2014
New revision: 275511
URL: https://svnweb.freebsd.org/changeset/base/275511

Log:
  MFC r275170:

    Convert sbin/mdconfig/tests from prove format tests to ATF format tests

    As a side effect...
    1. The tests now checks for the root user before continuing with kyua, which is
       more visible than the test being skipped with the TAP protocol
    2. The tests work with devices that aren't /dev/md0 by caching the device
       attached during the test to a file, and later use the cached information to
       detach the device in the cleanup routine
    3. The tests no longer require perl to run

    PR: 191191
    Sponsored by: EMC / Isilon Storage Division

Changes:
_U  stable/10/
  stable/10/ObsoleteFiles.inc
  stable/10/sbin/mdconfig/tests/Makefile
  stable/10/sbin/mdconfig/tests/legacy_test.sh
  stable/10/sbin/mdconfig/tests/mdconfig.test
  stable/10/sbin/mdconfig/tests/mdconfig_test.sh
  stable/10/sbin/mdconfig/tests/run.pl