Skip to content

Commit

Permalink
Move raise() tests to unittest/actions/raise with updates
Browse files Browse the repository at this point in the history
Tests have been updated to not depend on trace() with a string argument.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Jun 18, 2021
1 parent f35847f commit 044e05f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 */

/* @@trigger: raise-tst-raise1 */
/* @@trigger-timing: after */
/* @@runtest-opts: $_pid */
Expand All @@ -30,7 +30,6 @@ BEGIN
syscall::ioctl:entry
/pid == $1 && !self->raised/
{
trace("raised");
raise(SIGINT);
/*
* Wait no more than three seconds for the process to die.
Expand All @@ -48,6 +47,5 @@ syscall::exit_group:entry
profile:::tick-4
/timestamp > timeout/
{
trace("timed out");
exit(1);
exit(124);
}
7 changes: 7 additions & 0 deletions test/unittest/actions/raise/tst.raise1.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUNCTION:NAME
ioctl:entry
exit_group:entry

-- @@stderr --
dtrace: script 'test/unittest/actions/raise/tst.raise1.d' matched 4 probes
dtrace: allowing destructive actions
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 */

/* @@trigger: raise-tst-raise2 */
/* @@trigger-timing: after */
/* @@runtest-opts: $_pid */
Expand All @@ -29,7 +29,6 @@ BEGIN
syscall::ioctl:return
/pid == $1/
{
trace("raised");
raise(SIGINT);
/*
* Wait no more than three seconds for the process to die.
Expand All @@ -46,6 +45,5 @@ syscall::exit_group:entry
profile:::tick-4
/timestamp > timeout/
{
trace("timed out");
exit(1);
exit(124);
}
7 changes: 7 additions & 0 deletions test/unittest/actions/raise/tst.raise2.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUNCTION:NAME
ioctl:return
exit_group:entry

-- @@stderr --
dtrace: script 'test/unittest/actions/raise/tst.raise2.d' matched 4 probes
dtrace: allowing destructive actions
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 */

/* @@trigger: raise-tst-raise3 */
/* @@trigger-timing: after */
/* @@runtest-opts: $_pid */
Expand All @@ -29,7 +29,6 @@ BEGIN
syscall::ioctl:entry
/pid == $1/
{
trace("raised");
raise(SIGINT);
/*
* Wait no more than three seconds for the process to die.
Expand All @@ -46,6 +45,5 @@ syscall::exit_group:entry
profile:::tick-4
/timestamp > timeout/
{
trace("timed out");
exit(1);
exit(124);
}
7 changes: 7 additions & 0 deletions test/unittest/actions/raise/tst.raise3.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FUNCTION:NAME
ioctl:entry
exit_group:entry

-- @@stderr --
dtrace: script 'test/unittest/actions/raise/tst.raise3.d' matched 4 probes
dtrace: allowing destructive actions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
Expand Down
7 changes: 0 additions & 7 deletions test/unittest/raise/tst.raise1.r

This file was deleted.

7 changes: 0 additions & 7 deletions test/unittest/raise/tst.raise2.r

This file was deleted.

7 changes: 0 additions & 7 deletions test/unittest/raise/tst.raise3.r

This file was deleted.

0 comments on commit 044e05f

Please sign in to comment.