code: def test_ioctl(self):
      # If this process has been put into the background, TIOCGPGRP returns
      # the session ID instead of the process group id.
      ids = (os.getpgrp(), os.getsid(0))
      with open("/dev/tty", "rb") as tty:
          r = fcntl.ioctl(tty, termios.TIOCGPGRP, "    ")
          rpgrp = struct.unpack("i", r)[0]
          self.assertIn(rpgrp, ids)
  
file_path: cpython/Lib/test/test_ioctl.py
imports: import array
  import unittest
  from test.support import get_attribute
  from test.support.import_helper import import_module
  import os, struct
label_desc: Use image node_id 1 for calling the IoctlTests obj's underlying member method code with example usage: obj.test_ioctl() without return types