]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/test-exec-deserialization.py
build-sys: bump package/library versions
[thirdparty/systemd.git] / test / test-exec-deserialization.py
index 39a9e62e154e498ecbe9718975feaca529384b1e..a11c5ecbf02de273596f523d957ce2d0673fe080 100755 (executable)
@@ -1,20 +1,7 @@
 #!/usr/bin/env python3
-
-#
-#  Copyright 2017 Michal Sekletar <msekleta@redhat.com>
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
+# SPDX-License-Identifier: LGPL-2.1+
 #
-#  systemd is distributed in the hope that it will be useful, but
-#  WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public License
-#  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+#  Copyright © 2017 Michal Sekletar <msekleta@redhat.com>
 
 # ATTENTION: This uses the *installed* systemd, not the one from the built
 # source tree.
@@ -178,6 +165,37 @@ class ExecutionResumeTest(unittest.TestCase):
 
         self.assertTrue(not os.path.exists(self.output_file))
 
+    def test_issue_6533(self):
+        unit = "test-issue-6533.service"
+        unitfile_path = "/run/systemd/system/{}".format(unit)
+
+        content = '''
+        [Service]
+        ExecStart=/bin/sleep 5
+        '''
+
+        with open(unitfile_path, 'w') as f:
+            f.write(content)
+
+        self.reload()
+
+        subprocess.check_call(['systemctl', '--job-mode=replace', '--no-block', 'start', unit])
+        time.sleep(2)
+
+        content = '''
+        [Service]
+        ExecStart=/bin/sleep 5
+        ExecStart=/bin/true
+        '''
+
+        with open(unitfile_path, 'w') as f:
+            f.write(content)
+
+        self.reload()
+        time.sleep(5)
+
+        self.assertTrue(subprocess.call("journalctl -b _PID=1  | grep -q 'Freezing execution'", shell=True) != 0)
+
     def tearDown(self):
         for f in [self.output_file, self.unitfile_path]:
             try: