Path: blob/master/test/jdk/tools/jpackage/test_jpackage.sh
41144 views
#!/bin/bash12# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.222324#25# Complete testing of jpackage platform-specific packaging.26#27# The script does the following:28# 1. Create packages.29# 2. Install created packages.30# 3. Verifies packages are installed.31# 4. Uninstall created packages.32# 5. Verifies packages are uninstalled.33#34# For the list of accepted command line arguments see `run_tests.sh` script.35#3637# Fail fast38set -e; set -o pipefail;3940# Script debug41dry_run=${JPACKAGE_TEST_DRY_RUN}4243# Default directory where jpackage should write bundle files44output_dir=~/jpackage_bundles454647set_args ()48{49args=()50local arg_is_output_dir=51local arg_is_mode=52local output_dir_set=53local with_append_actions=yes54for arg in "$@"; do55if [ "$arg" == "-o" ]; then56arg_is_output_dir=yes57output_dir_set=yes58elif [ "$arg" == "-m" ]; then59arg_is_mode=yes60continue61elif [ "$arg" == '--' ]; then62append_actions63with_append_actions=64continue65elif ! case "$arg" in -Djpackage.test.action=*) false;; esac; then66continue67elif [ -n "$arg_is_output_dir" ]; then68arg_is_output_dir=69output_dir="$arg"70elif [ -n "$arg_is_mode" ]; then71arg_is_mode=72continue73fi7475args+=( "$arg" )76done77[ -n "$output_dir_set" ] || args=( -o "$output_dir" "${args[@]}" )78[ -z "$with_append_actions" ] || append_actions79}808182append_actions ()83{84args+=( '--' '-Djpackage.test.action=create,install,verify-install,uninstall,verify-uninstall' )85}868788exec_command ()89{90if [ -n "$dry_run" ]; then91echo "$@"92else93eval "$@"94fi95}9697set_args "$@"98basedir="$(dirname $0)"99exec_command ${SHELL} "$basedir/run_tests.sh" -m create "${args[@]}"100101102