Sun Mar 27 08:53:57 2011 UTC ()
validate that getrawpartition() didn't fail.


(mlelstv)
diff -r1.2 -r1.3 src/tests/dev/scsipi/t_cd.c

cvs diff -r1.2 -r1.3 src/tests/dev/scsipi/t_cd.c (expand / switch to unified diff)

--- src/tests/dev/scsipi/t_cd.c 2010/09/11 16:03:41 1.2
+++ src/tests/dev/scsipi/t_cd.c 2011/03/27 08:53:56 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: t_cd.c,v 1.2 2010/09/11 16:03:41 martin Exp $ */ 1/* $NetBSD: t_cd.c,v 1.3 2011/03/27 08:53:56 mlelstv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2010 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -40,29 +40,30 @@ @@ -40,29 +40,30 @@
40#include "../../h_macros.h" 40#include "../../h_macros.h"
41 41
42ATF_TC(noisyeject); 42ATF_TC(noisyeject);
43ATF_TC_HEAD(noisyeject, tc) 43ATF_TC_HEAD(noisyeject, tc)
44{ 44{
45 45
46 atf_tc_set_md_var(tc, "descr", "test for CD eject noisyness " 46 atf_tc_set_md_var(tc, "descr", "test for CD eject noisyness "
47 "(PR kern/43785)"); 47 "(PR kern/43785)");
48} 48}
49 49
50ATF_TC_BODY(noisyeject, tc) 50ATF_TC_BODY(noisyeject, tc)
51{ 51{
52 static char fname[] = "/dev/rcd0_"; 52 static char fname[] = "/dev/rcd0_";
53 int fd, arg = 0; 53 int part, fd, arg = 0;
54 54
55 fname[strlen(fname)-1] = 'a' + getrawpartition(); 55 RL(part = getrawpartition());
 56 fname[strlen(fname)-1] = 'a' + part;
56 rump_init(); 57 rump_init();
57 RL(fd = rump_sys_open(fname, O_RDWR)); 58 RL(fd = rump_sys_open(fname, O_RDWR));
58 RL(rump_sys_ioctl(fd, DIOCEJECT, &arg)); 59 RL(rump_sys_ioctl(fd, DIOCEJECT, &arg));
59 60
60 ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0); 61 ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
61 RL(rump_sys_close(fd)); 62 RL(rump_sys_close(fd));
62 atf_tc_expect_fail("PR kern/43785"); 63 atf_tc_expect_fail("PR kern/43785");
63 ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0); 64 ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
64} 65}
65 66
66ATF_TP_ADD_TCS(tp) 67ATF_TP_ADD_TCS(tp)
67{ 68{
68 69