]> git.proxmox.com Git - systemd.git/commitdiff
autopkgtest: Ship/use mock fsck from debian/tests, as it's missing in the 220 tarball
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 26 May 2015 05:22:45 +0000 (07:22 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 26 May 2015 05:22:45 +0000 (07:22 +0200)
Fixed upstream in commit db47294f41, this can be reverted with the next upstream
release.

debian/changelog
debian/tests/fsck [new file with mode: 0755]
debian/tests/systemd-fsckd

index b7e88bcfc2dc4a4cf55435d1291f6434b97796e9..aa5de983831062147d0859886c9b622f0c0913e7 100644 (file)
@@ -16,6 +16,8 @@ systemd (220-1) UNRELEASED; urgency=medium
   * debian/rules: Remove shipped audit_type-to-name.h and
     keyboard-keys-from-name.gperf and regenerate them during build (bug in
     upstream 220 tarball).
+  * autopkgtest: Ship/use mock fsck from debian/tests, as it's missing in the
+    220 tarball.
 
  -- Martin Pitt <mpitt@debian.org>  Fri, 22 May 2015 14:41:48 +0200
 
diff --git a/debian/tests/fsck b/debian/tests/fsck
new file mode 100755 (executable)
index 0000000..77b50d7
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+fd=0
+
+OPTIND=1
+while getopts "C:aTlM" opt; do
+    case "$opt" in
+        C)
+            fd=$OPTARG
+            ;;
+        \?);;
+    esac
+done
+
+shift "$((OPTIND-1))"
+device=$1
+
+echo "Running fake fsck on $device"
+
+declare -a maxpass=(30 5 2 30 60)
+
+for pass in {1..5}; do
+    maxprogress=${maxpass[$((pass-1))]}
+    for (( current=0; current<=${maxprogress}; current++)); do
+        echo "$pass $current $maxprogress $device">&$fd
+        sleep 0.1
+    done
+done
index 4aa0ea37be90ed25787d6e470426b97fab48ed5c..d73738d0b5a95925a5f567d1841b6f4d5bee2634 100755 (executable)
@@ -53,7 +53,7 @@ class FsckdTest(unittest.TestCase):
             os.rename(SYSTEM_FSCK_PATH, SAVED_FSCK_PATH)
 
         # install mock fsck and killer
-        self.install_bin(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'test', 'mocks', 'fsck'),
+        self.install_bin(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fsck'),
                          SYSTEM_FSCK_PATH)
         self.install_bin(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'process-killer'),
                          PROCESS_KILLER_PATH)