~niedbalski/ubuntu/vivid/neutron/fixes-1447803

« back to all changes in this revision

Viewing changes to neutron/tests/unit/test_linux_external_process.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-10-03 18:45:23 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20141003184523-4mt6dy1q3j8n30c9
Tags: 1:2014.2~rc1-0ubuntu1
* New upstream release candidate:
  - d/p/*: Refreshed.
  - d/control: Add python-requests-mock to BD's.
  - d/control: Align versioned requirements with upstream.
* Transition linuxbridge and openvswitch plugin users to modular
  layer 2 plugin (LP: #1323729):
  - d/control: Mark removed plugin packages as transitional, depend
    on neutron-plugin-ml2, mark oldlibs/extra.
  - d/neutron-plugin-{linuxbridge,openvswitch}.install: Drop.
  - d/control: Depend on neutron-plugin-ml2 for linuxbridge
    agent package.
  - d/neutron-plugin-linuxbridge-agent.upstart: Use ml2 plugin
    configuration files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
12
#    License for the specific language governing permissions and limitations
13
13
#    under the License.
14
 
#
15
 
# @author: Mark McClain, DreamHost
16
14
 
17
15
import mock
18
16
 
43
41
                name.assert_called_once_with(ensure_pids_dir=True)
44
42
                self.execute.assert_called_once_with(['the', 'cmd'],
45
43
                                                     root_helper='sudo',
46
 
                                                     check_exit_code=True)
 
44
                                                     check_exit_code=True,
 
45
                                                     extra_ok_codes=None)
47
46
 
48
47
    def test_enable_with_namespace(self):
49
48
        callback = mock.Mock()
124
123
            isdir.return_value = True
125
124
            manager = ep.ProcessManager(self.conf, 'uuid')
126
125
            retval = manager.get_pid_file_name(ensure_pids_dir=True)
127
 
            self.assertEqual(retval, '/var/path/uuid/pid')
 
126
            self.assertEqual(retval, '/var/path/uuid.pid')
128
127
 
129
128
    def test_get_pid_file_name_not_existing(self):
130
129
        with mock.patch.object(ep.utils.os.path, 'isdir') as isdir:
132
131
                isdir.return_value = False
133
132
                manager = ep.ProcessManager(self.conf, 'uuid')
134
133
                retval = manager.get_pid_file_name(ensure_pids_dir=True)
135
 
                self.assertEqual(retval, '/var/path/uuid/pid')
136
 
                makedirs.assert_called_once_with('/var/path/uuid', 0o755)
 
134
                self.assertEqual(retval, '/var/path/uuid.pid')
 
135
                makedirs.assert_called_once_with('/var/path', 0o755)
137
136
 
138
137
    def test_get_pid_file_name_default(self):
139
138
        with mock.patch.object(ep.utils.os.path, 'isdir') as isdir:
140
139
            isdir.return_value = True
141
140
            manager = ep.ProcessManager(self.conf, 'uuid')
142
141
            retval = manager.get_pid_file_name(ensure_pids_dir=False)
143
 
            self.assertEqual(retval, '/var/path/uuid/pid')
 
142
            self.assertEqual(retval, '/var/path/uuid.pid')
144
143
            self.assertFalse(isdir.called)
145
144
 
146
145
    def test_pid(self):