[Libguestfs] [PATCH 1/3] Rename icat command in download_inode

Matteo Cafasso noxdafox at gmail.com
Wed Mar 30 19:18:08 UTC 2016


The "icat" name comes from the employed command line tool which might be
replaced at any time with a different implementation.

The command name is a bit confusing because it's similar to "cat" but
act as "donwload".

download_inode is more clear and descriptive.

Signed-off-by: Matteo Cafasso <noxdafox at gmail.com>
---
 daemon/sleuthkit.c               |  2 +-
 generator/actions.ml             |  2 +-
 tests/tsk/Makefile.am            |  2 +-
 tests/tsk/test-download-inode.sh | 53 ++++++++++++++++++++++++++++++++++++++++
 tests/tsk/test-icat.sh           | 53 ----------------------------------------
 5 files changed, 56 insertions(+), 56 deletions(-)
 create mode 100755 tests/tsk/test-download-inode.sh
 delete mode 100755 tests/tsk/test-icat.sh

diff --git a/daemon/sleuthkit.c b/daemon/sleuthkit.c
index 0fe1250..2f8c97b 100644
--- a/daemon/sleuthkit.c
+++ b/daemon/sleuthkit.c
@@ -40,7 +40,7 @@ optgroup_sleuthkit_available (void)
 }

 int
-do_icat (const mountable_t *mountable, int64_t inode)
+do_download_inode (const mountable_t *mountable, int64_t inode)
 {
   CLEANUP_FREE char *cmd = NULL;

diff --git a/generator/actions.ml b/generator/actions.ml
index ff72cfe..e5cb939 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12946,7 +12946,7 @@ The filesystem from which to extract the file must be unmounted,
 otherwise the call will fail." };

   { defaults with
-    name = "icat"; added = (1, 33, 14);
+    name = "download_inode"; added = (1, 33, 14);
     style = RErr, [Mountable "device"; Int64 "inode"; FileOut "filename"], [];
     proc_nr = Some 464;
     optional = Some "sleuthkit";
diff --git a/tests/tsk/Makefile.am b/tests/tsk/Makefile.am
index e060e58..0cd7c03 100644
--- a/tests/tsk/Makefile.am
+++ b/tests/tsk/Makefile.am
@@ -18,7 +18,7 @@
 include $(top_srcdir)/subdir-rules.mk

 TESTS = \
-	test-icat.sh
+	test-download-inode.sh

 TESTS_ENVIRONMENT = $(top_builddir)/run --test

diff --git a/tests/tsk/test-download-inode.sh b/tests/tsk/test-download-inode.sh
new file mode 100755
index 0000000..9c65aa9
--- /dev/null
+++ b/tests/tsk/test-download-inode.sh
@@ -0,0 +1,53 @@
+#!/bin/bash -
+# libguestfs
+# Copyright (C) 2016 Red Hat Inc.
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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.
+
+# Test the download_inode command.
+
+set -e
+
+if [ -n "$SKIP_TEST_DOWNLOAD_INODE_SH" ]; then
+    echo "$0: test skipped because environment variable is set."
+    exit 77
+fi
+
+rm -f test-mft.bin
+
+# Skip if TSK is not supported by the appliance.
+if ! guestfish add /dev/null : run : available "sleuthkit"; then
+    echo "$0: skipped because TSK is not available in the appliance"
+    exit 77
+fi
+
+if [ ! -s ../../test-data/phony-guests/windows.img ]; then
+    echo "$0: skipped because windows.img is zero-sized"
+    exit 77
+fi
+
+# download Master File Table ($MFT).
+guestfish --ro -a ../../test-data/phony-guests/windows.img <<EOF
+run
+download-inode /dev/sda2 0 test-mft.bin
+EOF
+
+# test extracted file is the Master File Table
+if [ `head -c 5 test-mft.bin` != "FILE0" ]; then
+    echo "$0: wrong file extracted."
+    exit 1
+fi
+
+rm -f test-mft.bin
diff --git a/tests/tsk/test-icat.sh b/tests/tsk/test-icat.sh
deleted file mode 100755
index 3b0fca4..0000000
--- a/tests/tsk/test-icat.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash -
-# libguestfs
-# Copyright (C) 2016 Red Hat Inc.
-#
-# 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; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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.
-
-# Test the icat command.
-
-set -e
-
-if [ -n "$SKIP_TEST_ICAT_SH" ]; then
-    echo "$0: test skipped because environment variable is set."
-    exit 77
-fi
-
-rm -f test-mft.bin
-
-# Skip if TSK is not supported by the appliance.
-if ! guestfish add /dev/null : run : available "sleuthkit"; then
-    echo "$0: skipped because TSK is not available in the appliance"
-    exit 77
-fi
-
-if [ ! -s ../../test-data/phony-guests/windows.img ]; then
-    echo "$0: skipped because windows.img is zero-sized"
-    exit 77
-fi
-
-# download Master File Table ($MFT).
-guestfish --ro -a ../../test-data/phony-guests/windows.img <<EOF
-run
-icat /dev/sda2 0 test-mft.bin
-EOF
-
-# test extracted file is the Master File Table
-if [ `head -c 5 test-mft.bin` != "FILE0" ]; then
-    echo "$0: wrong file extracted."
-    exit 1
-fi
-
-rm -f test-mft.bin
--
2.8.0.rc3




More information about the Libguestfs mailing list