code: def test_flock(self):
      # Solaris needs readable file for shared lock
      self.f = open(TESTFN, "wb+")
      fileno = self.f.fileno()
      fcntl.flock(fileno, fcntl.LOCK_SH)
      fcntl.flock(fileno, fcntl.LOCK_UN)
      fcntl.flock(self.f, fcntl.LOCK_SH | fcntl.LOCK_NB)
      fcntl.flock(self.f, fcntl.LOCK_UN)
      fcntl.flock(fileno, fcntl.LOCK_EX)
      fcntl.flock(fileno, fcntl.LOCK_UN)
  
      self.assertRaises(ValueError, fcntl.flock, -1, fcntl.LOCK_SH)
      self.assertRaises(TypeError, fcntl.flock, "spam", fcntl.LOCK_SH)
  
imports: import multiprocessing
  import platform
  import os
  import struct
  import sys
  import unittest
  from test.support import verbose, cpython_only, get_pagesize
  from test.support.import_helper import import_module
  from test.support.os_helper import TESTFN, unlink
label_desc: Use image node_id 9 for calling the TestFcntl obj's underlying member method code with example usage: obj.test_flock() without return types