Enabling network manager inside docker

I am preparing a test automation which require me to install network manager so that the code api(which uses python3-networkmanager) could be tested.

In the docker file, I tried installing:

apt-get install dbus 
                network-manager

start receiving error:

networkmanager.systems do not have hostname property. 

I looked for solutions, but appears that will require:

  1. Privilege user (cannot use privilege user, project requirement)
  2. Reboot after installing same. (in docker, hence, can’t reboot)

This leaves me with an only option for mocking debian networkmanager that can communicate with python3-networkmanager.

Trying to figure out, how I can mock same?

Source: StackOverflow