socsvn commit: r256964 - soc2013/mattbw/tests

mattbw at FreeBSD.org mattbw at FreeBSD.org
Thu Sep 5 19:51:00 UTC 2013


Author: mattbw
Date: Thu Sep  5 19:50:59 2013
New Revision: 256964
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256964

Log:
  Add basic functional test script for installing and uninstalling a test package.

Added:
  soc2013/mattbw/tests/ftest-install-remove-single.sh   (contents, props changed)

Added: soc2013/mattbw/tests/ftest-install-remove-single.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ soc2013/mattbw/tests/ftest-install-remove-single.sh	Thu Sep  5 19:50:59 2013	(r256964)
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Functional test for installing/removing based on test repositories.
+
+# Expect testpkg not to be installed initially
+if [ -f /usr/local/testpkgs/testfile ]
+then
+	echo "Please remove testpkg and try again."
+	exit
+fi
+
+# It should come up as available...
+RESOLVE=`pkcon resolve --filter "~installed" testpkg | grep "Available.*"`
+if [ -z "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is not showing as available."
+	exit
+fi
+
+# ...but not installed.
+RESOLVE=`pkcon resolve --filter "installed" testpkg | grep "Installed.*"`
+if [ -n "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is showing as installed."
+	exit
+fi
+
+# ToDo: put more tests here?
+
+pkcon install testpkg
+
+# Expect testpkg to now be installed
+if [ ! -f /usr/local/testpkgs/testfile ]
+then
+	echo "Test failed: testpkg was not installed."
+	exit
+fi
+
+# It should come up as available...
+RESOLVE=`pkcon resolve --filter "~installed" testpkg | grep "Available.*"`
+if [ -n "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is showing as available post-install."
+	exit
+fi
+
+# ...but not installed.
+RESOLVE=`pkcon resolve --filter "installed" testpkg | grep "Installed.*"`
+if [ -z "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is not showing as installed post-install."
+	exit
+fi
+
+pkcon remove testpkg
+
+# Expect testpkg to now be uninstalled again
+if [ -f /usr/local/testpkgs/testfile ]
+then
+	echo "Test failed: testpkg was not uninstalled."
+	exit
+fi
+
+# It should once more come up as available...
+RESOLVE=`pkcon resolve --filter "~installed" testpkg | grep "Available.*"`
+if [ -z "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is not showing as available post-remove."
+	exit
+fi
+
+# ...but not installed.
+RESOLVE=`pkcon resolve --filter "installed" testpkg | grep "Installed.*"`
+if [ -n "${RESOLVE}" ]
+then
+	echo "Test failed: testpkg is showing as installed post-remove."
+	exit
+fi
+
+echo "Test succeeded."


More information about the svn-soc-all mailing list