From owner-svn-soc-all@FreeBSD.ORG Thu Sep 5 19:51:00 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9474182E for ; Thu, 5 Sep 2013 19:51:00 +0000 (UTC) (envelope-from mattbw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 670D72C6D for ; Thu, 5 Sep 2013 19:51:00 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r85Jp0sx026991 for ; Thu, 5 Sep 2013 19:51:00 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r85Jp03C026985 for svn-soc-all@FreeBSD.org; Thu, 5 Sep 2013 19:51:00 GMT (envelope-from mattbw@FreeBSD.org) Date: Thu, 5 Sep 2013 19:51:00 GMT Message-Id: <201309051951.r85Jp03C026985@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mattbw@FreeBSD.org using -f From: mattbw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r256964 - soc2013/mattbw/tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 19:51:00 -0000 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."