code: def test_glibc_version_string(version_str, expected, monkeypatch):
      class LibcVersion:
          def __init__(self, version_str):
              self.version_str = version_str
  
          def __call__(self):
              return version_str
  
      class ProcessNamespace:
          def __init__(self, libc_version):
              self.gnu_get_libc_version = libc_version
  
      process_namespace = ProcessNamespace(LibcVersion(version_str))
      monkeypatch.setattr(ctypes, "CDLL", lambda _: process_namespace)
      monkeypatch.setattr(
          _manylinux, "_glibc_version_string_confstr", lambda: False
      )
  
      assert _glibc_version_string() == expected
  
      del process_namespace.gnu_get_libc_version
      assert _glibc_version_string() is None
  
imports: import os
  import pathlib
  import platform
  import sys
  import types
  import warnings
  import pretend
  import pytest
  from packaging import _manylinux
  from packaging._manylinux import _get_glibc_version, _glibc_version_string, _glibc_version_string_confstr, _glibc_version_string_ctypes, _is_compatible, _parse_elf, _parse_glibc_version
label_desc: Use image node_id 7 for calling a global function with example usage: test_glibc_version_string(version_str, expected, monkeypatch) and returns: version_str