• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (C) 2017 Red Hat, Inc.
4#
5# Test if gdb can successfully attach to a process and
6# this process exits normally.
7
8TST_TESTFUNC=simple_test
9TST_NEEDS_CMDS="gdb /bin/cat"
10
11. tst_test.sh
12
13simple_test()
14{
15	gdb /bin/cat -ex "run /etc/passwd" -ex quit < /dev/null
16	RC=$?
17	if [ $RC -eq 0 ] ; then
18		tst_res TPASS "gdb attached to process and completed run"
19	else
20		tst_res TFAIL "gdb test failed with" $RC
21	fi
22}
23
24tst_run
25