code: def test_linkchain(_temp_analyze_files):
      if os.name != "posix":
          return
      orig_img, orig_hdr = _temp_analyze_files
      pth, fname = os.path.split(orig_img)
      new_img1 = os.path.join(pth, "newfile1.img")
      new_hdr1 = os.path.join(pth, "newfile1.hdr")
      new_img2 = os.path.join(pth, "newfile2.img")
      new_hdr2 = os.path.join(pth, "newfile2.hdr")
      new_img3 = os.path.join(pth, "newfile3.img")
      new_hdr3 = os.path.join(pth, "newfile3.hdr")
      copyfile(orig_img, new_img1)
      assert os.path.islink(new_img1)
      assert os.path.islink(new_hdr1)
      copyfile(new_img1, new_img2, copy=True)
      assert not os.path.islink(new_img2)
      assert not os.path.islink(new_hdr2)
      assert not os.path.samefile(orig_img, new_img2)
      assert not os.path.samefile(orig_hdr, new_hdr2)
      copyfile(new_img1, new_img3, copy=True, use_hardlink=True)
      assert not os.path.islink(new_img3)
      assert not os.path.islink(new_hdr3)
      assert os.path.samefile(orig_img, new_img3)
      assert os.path.samefile(orig_hdr, new_hdr3)
  
imports: import os
  import time
  from pathlib import Path
  from unittest import mock, SkipTest
  import pytest
  from ...testing import TempFATFS
  from ...utils.filemanip import save_json, load_json, fname_presuffix, fnames_presuffix, hash_rename, check_forhash, _parse_mount_table, _cifs_table, on_cifs, copyfile, copyfiles, ensure_list, simplify_list, check_depends, split_filename, get_related_files, indirectory, loadpkl, loadcrash, savepkl, path_resolve, write_rst_list, emptydirs
label_desc: Use image node_id 12 for calling a global function with example usage: test_linkchain(_temp_analyze_files) without return types