Esempio n. 1
0
def loader_segload_sys_load_unload_test(buildlibnix, mem_alloc):
    mem, alloc = mem_alloc
    lib_file = buildlibnix.make_lib('testnix')
    loader = SegmentLoader(alloc)
    # load
    baddr = loader.load_sys_seglist(lib_file)
    assert baddr > 0
    info = loader.get_info(baddr)
    assert info.seglist.get_baddr() == baddr
    # unload
    ok = loader.unload_seglist(baddr)
    assert ok
    info = loader.get_info(baddr)
    assert info is None
    assert loader.shutdown() == 0
    assert alloc.is_all_free()
Esempio n. 2
0
def loader_segload_sys_load_unload_test(buildlibnix, mem_alloc):
  mem, alloc = mem_alloc
  lib_file = buildlibnix.make_lib('testnix')
  loader = SegmentLoader(alloc)
  # load
  baddr = loader.load_sys_seglist(lib_file)
  assert baddr > 0
  info = loader.get_info(baddr)
  assert info.seglist.get_baddr() == baddr
  # unload
  ok = loader.unload_seglist(baddr)
  assert ok
  info = loader.get_info(baddr)
  assert info is None
  assert loader.shutdown() == 0
  assert alloc.is_all_free()
Esempio n. 3
0
def loader_segload_ami_load_unload_test(buildlibnix, mem_alloc):
  mem, alloc = mem_alloc
  lib_file = buildlibnix.make_lib('testnix')

  class PathMgrMock:
    def ami_to_sys_path(self, lock, ami_path, mustExist=True):
      if ami_path == "blu":
        return lib_file
  pm = PathMgrMock()
  loader = SegmentLoader(alloc, path_mgr=pm)
  # load
  baddr = loader.load_ami_seglist("blu")
  assert baddr > 0
  info = loader.get_info(baddr)
  assert info.seglist.get_baddr() == baddr
  # unload
  ok = loader.unload_seglist(baddr)
  assert ok
  info = loader.get_info(baddr)
  assert info is None
  assert loader.shutdown() == 0
  assert alloc.is_all_free()
Esempio n. 4
0
def loader_segload_ami_load_unload_test(buildlibnix, mem_alloc):
    mem, alloc = mem_alloc
    lib_file = buildlibnix.make_lib('testnix')

    class PathMgrMock:
        def ami_to_sys_path(self, lock, ami_path, mustExist=True):
            if ami_path == "blu":
                return lib_file

    pm = PathMgrMock()
    loader = SegmentLoader(alloc, path_mgr=pm)
    # load
    baddr = loader.load_ami_seglist("blu")
    assert baddr > 0
    info = loader.get_info(baddr)
    assert info.seglist.get_baddr() == baddr
    # unload
    ok = loader.unload_seglist(baddr)
    assert ok
    info = loader.get_info(baddr)
    assert info is None
    assert loader.shutdown() == 0
    assert alloc.is_all_free()