summaryrefslogtreecommitdiff
path: root/tests.as-root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests.as-root/lib')
-rw-r--r--tests.as-root/lib36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests.as-root/lib b/tests.as-root/lib
deleted file mode 100644
index d17d8e32..00000000
--- a/tests.as-root/lib
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2012 Codethink Limited
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-## Helper functions for as-root tests
-
-loopback_rootfs() {
- # Find offset partition offset in a rootfs and mount it
- ROOTFS="$1"
-
- PYTHONPATH="$SRCDIR" "$SRCDIR/scripts/sparse-gunzip" \
- <"$ROOTFS" >"$ROOTFS-unzipped"
-
- OFFSET=$(sfdisk -d "$ROOTFS-unzipped" | \
- grep -m 1 -o 'start=\s\+\([0-9]\+\)' | awk '{ print $2 }')
- OFFSET=$(expr "$OFFSET" '*' 512)
-
- DEVICE=$(losetup --show -o "$OFFSET" -f "$ROOTFS-unzipped")
- udevadm settle
-
- echo "$DEVICE"
-}