Rackspace-DOT / nova-agent

Other
4 stars 18 forks source link

clear NOTIFY_SOCKET environment variable correctly #64

Closed carlwgeorge closed 5 years ago

carlwgeorge commented 5 years ago

The goal of this test is to ensure utils.notify_socket returns the correct None values when NOTIFY_SOCKET is not set. However, mock.patch.dict by default only adds to the in_dict, it doesn't clear it. This test passed up until now just by concidence of NOTIFY_SOCKET not being set in Travis or in RPM mock (not the same thing as python mock) builds. RPM mock now using systemd-nspawn, which sets NOTIFY_SOCKET, exposing the flaw.