diff options
author | Zuul <zuul@review.opendev.org> | 2019-05-30 21:50:23 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-05-30 21:50:24 +0000 |
commit | 4f03661f6878c1e5103683fa496202b166b3cf08 (patch) | |
tree | 6907d88222c4203d1fe4c1fb17ef1130dde7911f | |
parent | c70b06984efb8b50af7e25acbc5799d734802e48 (diff) | |
parent | 8531d14c22aadbec3acdcaec6c566493f606dbf5 (diff) | |
download | ironic-python-agent-4f03661f6878c1e5103683fa496202b166b3cf08.tar.gz |
Merge "Bind mount /run into chroot when installing grub" into stable/rocky
-rw-r--r-- | ironic_python_agent/extensions/image.py | 2 | ||||
-rw-r--r-- | ironic_python_agent/tests/unit/extensions/test_image.py | 16 | ||||
-rw-r--r-- | releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml | 4 |
3 files changed, 21 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index e5b1b1aa..5b24e3a4 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -30,7 +30,7 @@ from ironic_python_agent import utils LOG = log.getLogger(__name__) -BIND_MOUNTS = ('/dev', '/proc') +BIND_MOUNTS = ('/dev', '/proc', '/run') def _get_partition(device, uuid): diff --git a/ironic_python_agent/tests/unit/extensions/test_image.py b/ironic_python_agent/tests/unit/extensions/test_image.py index 74942fa4..4edfa783 100644 --- a/ironic_python_agent/tests/unit/extensions/test_image.py +++ b/ironic_python_agent/tests/unit/extensions/test_image.py @@ -104,6 +104,8 @@ class TestImageExtension(base.IronicAgentTest): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call(('chroot %s /bin/sh -c ' @@ -119,6 +121,8 @@ class TestImageExtension(base.IronicAgentTest): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, @@ -143,6 +147,8 @@ class TestImageExtension(base.IronicAgentTest): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call(('chroot %s /bin/sh -c ' @@ -159,6 +165,8 @@ class TestImageExtension(base.IronicAgentTest): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, @@ -189,6 +197,8 @@ class TestImageExtension(base.IronicAgentTest): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call('mount', self.fake_efi_system_part, @@ -212,6 +222,8 @@ class TestImageExtension(base.IronicAgentTest): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, @@ -249,6 +261,8 @@ class TestImageExtension(base.IronicAgentTest): self.fake_dir + '/dev'), mock.call('mount', '-o', 'bind', '/proc', self.fake_dir + '/proc'), + mock.call('mount', '-o', 'bind', '/run', + self.fake_dir + '/run'), mock.call('mount', '-t', 'sysfs', 'none', self.fake_dir + '/sys'), mock.call('mount', self.fake_efi_system_part, @@ -294,6 +308,8 @@ class TestImageExtension(base.IronicAgentTest): attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/proc', attempts=3, delay_on_retry=True), + mock.call('umount', self.fake_dir + '/run', + attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir + '/sys', attempts=3, delay_on_retry=True), mock.call('umount', self.fake_dir, attempts=3, diff --git a/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml b/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml new file mode 100644 index 00000000..bdeb00db --- /dev/null +++ b/releasenotes/notes/bindmount-run-4c6a31d3ee4e0ed6.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Mounts /run into chroot when installing grub to prevent timeouts. |