def setup_swapmem(self):
    swapfile = SWAPAllocator.SWAP_FILE_PATH
    with open(swapfile, 'wb') as fd:
        os.posix_fallocate(fd.fileno(), 0, (self.swap_mem_size * SWAPAllocator.MiB_TO_BYTES_FACTOR))
    os.chmod(swapfile, 384)
    run_command(f'mkswap {swapfile}; swapon {swapfile}')
def setup_swapmem(self):
    swapfile = SWAPAllocator.SWAP_FILE_PATH
    with open(swapfile, 'wb') as fd:
        os.posix_fallocate(fd.fileno(), 0, (self.swap_mem_size * SWAPAllocator.MiB_TO_BYTES_FACTOR))
    os.chmod(swapfile, 384)
    run_command(f'mkswap {swapfile}; swapon {swapfile}')