From ea07c9cfedebe8b15e93b38d8bd8daea66534fe4 Mon Sep 17 00:00:00 2001 From: Dmitriy Gertsog Date: Mon, 12 May 2025 20:10:39 +0300 Subject: [PATCH 1/2] uninstall: add tt uninstall tcm command This commit adds the ability to remove installed TCM package using the `tt uninstall tcm` command. The TCM uninstallation works like to the removing other Tarantool executables. @TarantoolBot Title: added `tt uninstall tcm` The command finds the locally installed version of TCM and removes it from the system. If no version is specified, the current version of TCM that is in use at the moment is deleted. If the actual version is deleted, the symbolic link `tcm` in the `bin` folder is also deleted. **Usage Example**: Remove specific TCM version: ```bash tt uninstall tcm 1.2.3-0-geae7e7d49 ``` Remove actual active TCM version: ```bash tt uninstall tcm ``` Closes #TNTP-1096 --- CHANGELOG.md | 2 ++ cli/cmd/uninstall.go | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58f5b1754..47f6040d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. manager (TCM) in the customer zone or local `distfiles` directory. - `tt install tcm` - the command performs an install for tarantool cluster manager (TCM) from the customer zone or local `distfiles` directory. +- `tt uninstall tcm [version]` - the command removes installed tarantool + cluster manager from the `bin` directory. - `tt tcm status`: added command to check TCM runtime status (modes: `watchdog` or `interactive`). - `tt tcm stop`: add command for graceful termination of TCM processes (modes: `watchdog` or `interactive`). diff --git a/cli/cmd/uninstall.go b/cli/cmd/uninstall.go index 0523843f3..1326f144c 100644 --- a/cli/cmd/uninstall.go +++ b/cli/cmd/uninstall.go @@ -90,6 +90,29 @@ func newUninstallTarantoolDevCmd() *cobra.Command { return tntCmd } +// newUninstallTcmCmd creates a command to install tarantool-ee. +func newUninstallTcmCmd() *cobra.Command { + tntCmd := &cobra.Command{ + Use: search.ProgramTcm.String() + " [version]", + Short: "Uninstall tarantool cluster manager", + Run: RunModuleFunc(InternalUninstallModule), + Args: cobra.MaximumNArgs(1), + ValidArgsFunction: func( + cmd *cobra.Command, + args []string, + toComplete string, + ) ([]string, cobra.ShellCompDirective) { + if len(args) > 0 { + return []string{}, cobra.ShellCompDirectiveNoFileComp + } + return uninstall.GetList(cliOpts, cmd.Name()), + cobra.ShellCompDirectiveNoFileComp + }, + } + + return tntCmd +} + // NewUninstallCmd creates uninstall command. func NewUninstallCmd() *cobra.Command { uninstallCmd := &cobra.Command{ @@ -106,6 +129,7 @@ func NewUninstallCmd() *cobra.Command { newUninstallTarantoolCmd(), newUninstallTarantoolEeCmd(), newUninstallTarantoolDevCmd(), + newUninstallTcmCmd(), ) return uninstallCmd From 02d33970b537fe966c27251c561e623d56497f1f Mon Sep 17 00:00:00 2001 From: Dmitriy Gertsog Date: Tue, 13 May 2025 13:50:52 +0300 Subject: [PATCH 2/2] test: add integration tests for EE uninstall Part of #TNTP-1096 --- cli/uninstall/uninstall.go | 61 +++-- cli/uninstall/uninstall_test.go | 22 +- cli/util/util.go | 2 + test/integration/ee/test_ee_uninstall.py | 238 ++++++++++++++++++ .../tarantool-ee/bin/tarantool | 1 + .../bin/tarantool-ee_gc64-2.11.6-0-r683 | 1 + .../bin/tarantool-ee_gc64-3.4.0-0-r60 | 1 + .../tarantool-ee/include/include/tarantool | 1 + .../tarantool-ee_gc64-2.11.6-0-r683/.gitkeep | 0 .../tarantool-ee_gc64-3.4.0-0-r60/.gitkeep | 0 .../2vers_installed/tarantool-ee/tt.yaml | 3 + .../ee/testdata/2vers_installed/tcm/bin/tcm | 1 + .../tcm/bin/tcm_1.2.0-11-g2d0a0f495 | 1 + .../tcm/bin/tcm_1.3.1-0-g074b5ffa | 1 + .../ee/testdata/2vers_installed/tcm/tt.yaml | 3 + .../bin/tarantool-ee_gc64-2.11.6-0-r683 | 1 + .../bin/tarantool-ee_gc64-3.4.0-0-r60 | 1 + .../tarantool-ee_gc64-2.11.6-0-r683/.gitkeep | 0 .../tarantool-ee_gc64-3.4.0-0-r60/.gitkeep | 0 .../tarantool-ee/tt.yaml | 3 + .../tcm/bin/tcm_1.2.0-11-g2d0a0f495 | 1 + .../tcm/bin/tcm_1.3.1-0-g074b5ffa | 1 + .../2vers_installed_no_active/tcm/tt.yaml | 3 + .../tarantool-ee/bin/tarantool | 1 + .../bin/tarantool-ee_gc64-2.11.6-0-r683 | 1 + .../bin/tarantool-ee_gc64-3.4.0-0-r60 | 1 + .../tarantool-ee/bin/tarantool_3.5.0 | 1 + .../tarantool-ee/include/include/tarantool | 1 + .../tarantool-ee_gc64-2.11.6-0-r683/.gitkeep | 0 .../tarantool-ee_gc64-3.4.0-0-r60/.gitkeep | 0 .../include/include/tarantool_3.5.0/.gitkeep | 0 .../3vers_installed/tarantool-ee/tt.yaml | 3 + .../ee/testdata/3vers_installed/tcm/bin/tcm | 1 + .../tcm/bin/tcm_1.2.0-11-g2d0a0f495 | 1 + .../tcm/bin/tcm_1.3.1-0-g074b5ffa | 1 + .../3vers_installed/tcm/bin/tcm_2d0a0f495 | 1 + .../ee/testdata/3vers_installed/tcm/tt.yaml | 3 + 37 files changed, 319 insertions(+), 42 deletions(-) create mode 100644 test/integration/ee/test_ee_uninstall.py create mode 120000 test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool create mode 100755 test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 create mode 100755 test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 create mode 120000 test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool create mode 100644 test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep create mode 100644 test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep create mode 100644 test/integration/ee/testdata/2vers_installed/tarantool-ee/tt.yaml create mode 120000 test/integration/ee/testdata/2vers_installed/tcm/bin/tcm create mode 100755 test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 create mode 100755 test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa create mode 100644 test/integration/ee/testdata/2vers_installed/tcm/tt.yaml create mode 100755 test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 create mode 100755 test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 create mode 100644 test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep create mode 100644 test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep create mode 100644 test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/tt.yaml create mode 100755 test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.2.0-11-g2d0a0f495 create mode 100755 test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.3.1-0-g074b5ffa create mode 100644 test/integration/ee/testdata/2vers_installed_no_active/tcm/tt.yaml create mode 120000 test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool create mode 100755 test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 create mode 100755 test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 create mode 100755 test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool_3.5.0 create mode 120000 test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool create mode 100644 test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep create mode 100644 test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep create mode 100644 test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool_3.5.0/.gitkeep create mode 100644 test/integration/ee/testdata/3vers_installed/tarantool-ee/tt.yaml create mode 120000 test/integration/ee/testdata/3vers_installed/tcm/bin/tcm create mode 100755 test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 create mode 100755 test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa create mode 100755 test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_2d0a0f495 create mode 100644 test/integration/ee/testdata/3vers_installed/tcm/tt.yaml diff --git a/cli/uninstall/uninstall.go b/cli/uninstall/uninstall.go index 60822f58e..e16696f64 100644 --- a/cli/uninstall/uninstall.go +++ b/cli/uninstall/uninstall.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "regexp" + "slices" "strings" "github.com/tarantool/tt/cli/install" @@ -18,13 +19,10 @@ import ( "github.com/tarantool/tt/cli/version" ) -var progRegexp = "(?P" + - search.ProgramTt.String() + "|" + - search.ProgramCe.String() + "|" + - search.ProgramEe.String() + ")" - const ( - verRegexp = "(?P.*)" + progRegexp = "(?P.+)" + + verRegexp = "(?P.+)" MajorMinorPatchRegexp = `^[0-9]+\.[0-9]+\.[0-9]+` ) @@ -34,7 +32,8 @@ var errNotInstalled = errors.New("program is not installed") // remove removes binary/directory and symlinks from directory. // It returns true if symlink was removed, error. func remove(program search.Program, programVersion string, directory string, - cmdCtx *cmdcontext.CmdCtx) (bool, error) { + cmdCtx *cmdcontext.CmdCtx, +) (bool, error) { var linkPath string var err error @@ -94,7 +93,8 @@ func UninstallProgram( programVersion string, binDst string, headerDst string, - cmdCtx *cmdcontext.CmdCtx) error { + cmdCtx *cmdcontext.CmdCtx, +) error { log.Infof("Removing binary...") var err error @@ -236,12 +236,12 @@ func GetList(cliOpts *config.CliOpts, program string) []string { } // searchLatestVersion searches for the latest installed version of the program. -func searchLatestVersion(linkName, binDst, headerDst string) (string, error) { - var programsToSearch []string - if linkName == "tarantool" { - programsToSearch = []string{search.ProgramCe.String(), search.ProgramEe.String()} - } else { - programsToSearch = []string{linkName} +// +// Note: Searching `tarantool` EE or Dev versions may lead to found the latest CE version. +func searchLatestVersion(program search.Program, binDst, headerDst string) (string, error) { + programsToSearch := []string{program.Exec()} + if program.IsTarantool() && program.Exec() != program.String() { + programsToSearch = append(programsToSearch, program.String()) } programRegex := regexp.MustCompile( @@ -255,7 +255,6 @@ func searchLatestVersion(linkName, binDst, headerDst string) (string, error) { latestVersionInfo := version.Version{} latestVersion := "" - hashFound := false latestHash := "" for _, binary := range binaries { @@ -272,31 +271,31 @@ func searchLatestVersion(linkName, binDst, headerDst string) (string, error) { } programName := matches["prog"] + // Need to find the program in the list of suitable. - if util.Find(programsToSearch, programName) == -1 { + if !slices.Contains(programsToSearch, programName) { continue } - isRightFormat, _ := util.IsValidCommitHash(matches["ver"]) - - if isRightFormat { - if hashFound { - continue - } - if strings.Contains(programName, "tarantool") { - // Check for headers. - if _, err := os.Stat(filepath.Join(headerDst, binaryName)); os.IsNotExist(err) { - continue + if latestHash == "" { + isHash, _ := util.IsValidCommitHash(matches["ver"]) + if isHash { + if program.IsTarantool() { + // Same version of headers is required to activate the Tarantool binary. + if _, err := os.Stat(filepath.Join(headerDst, binaryName)); os.IsNotExist(err) { + continue + } } + latestHash = binaryName + continue } - hashFound = true - latestHash = binaryName - continue } + ver, err := version.Parse(matches["ver"]) if err != nil { + log.Debugf("%q skipped: wrong version format", binaryName) continue } - if strings.Contains(programName, "tarantool") { + if program.IsTarantool() { // Check for headers. if _, err := os.Stat(filepath.Join(headerDst, binaryName)); os.IsNotExist(err) { continue @@ -318,7 +317,7 @@ func searchLatestVersion(linkName, binDst, headerDst string) (string, error) { func switchProgramToLatestVersion(program search.Program, binDst, headerDst string) error { linkName := program.Exec() - progToSwitch, err := searchLatestVersion(linkName, binDst, headerDst) + progToSwitch, err := searchLatestVersion(program, binDst, headerDst) if err != nil { return err } diff --git a/cli/uninstall/uninstall_test.go b/cli/uninstall/uninstall_test.go index b6d82fcaf..df0b5f349 100644 --- a/cli/uninstall/uninstall_test.go +++ b/cli/uninstall/uninstall_test.go @@ -36,7 +36,7 @@ func TestGetList(t *testing.T) { cfgData := []byte("tt:\n app:\n bin_dir: " + binDir) cfgPath := filepath.Join(workDir, "tt.yaml") - err = os.WriteFile(cfgPath, cfgData, 0400) + err = os.WriteFile(cfgPath, cfgData, 0o400) require.NoError(t, err) files := []string{ @@ -65,7 +65,7 @@ func TestGetList(t *testing.T) { func TestSearchLatestVersion(t *testing.T) { type testCase struct { name string - linkName string + program search.Program binDst string headerDst string expectedVer string @@ -75,42 +75,42 @@ func TestSearchLatestVersion(t *testing.T) { cases := []testCase{ { name: "basic", - linkName: "tarantool", + program: search.ProgramCe, binDst: "./testdata/bin_basic", headerDst: "./testdata/inc_basic", expectedVer: "tarantool_3.0.0-entrypoint", }, { name: "no includes", - linkName: "tarantool", + program: search.ProgramEe, binDst: "./testdata/bin_basic", headerDst: "./testdata/inc_invalid", expectedVer: "tarantool-ee_2.8.4-0-r510", }, { name: "tarantool-dev", - linkName: "tarantool", + program: search.ProgramCe, binDst: "./testdata/bin_dev", headerDst: "./testdata/inc_basic", expectedVer: "", }, { name: "hash version", - linkName: "tarantool", + program: search.ProgramCe, binDst: "./testdata/bin_hash", headerDst: "./testdata/inc_hash", expectedVer: "tarantool_aaaaaaa", }, { name: "hash invalid headers", - linkName: "tarantool", + program: search.ProgramCe, binDst: "./testdata/bin_hash", headerDst: "./testdata/inc_invalid_hash", expectedVer: "tarantool_bbbbbbb", }, { name: "tt, include-dir basic", - linkName: "tt", + program: search.ProgramTt, binDst: "./testdata/bin_basic", headerDst: "./testdata/inc_basic", expectedVer: "tt_2.0.0", @@ -118,14 +118,14 @@ func TestSearchLatestVersion(t *testing.T) { // Test that include dir doesn't affect the search for `tt`. { name: "tt, include-dir invalid", - linkName: "tt", + program: search.ProgramTt, binDst: "./testdata/bin_basic", headerDst: "./testdata/inc_invalid", expectedVer: "tt_2.0.0", }, { name: "filename as a bin dir", - linkName: "tt", + program: search.ProgramTt, binDst: "./testdata/bin_basic/tarantool", headerDst: "./testdata/inc_basic", isErr: true, @@ -134,7 +134,7 @@ func TestSearchLatestVersion(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - ver, err := searchLatestVersion(tc.linkName, tc.binDst, tc.headerDst) + ver, err := searchLatestVersion(tc.program, tc.binDst, tc.headerDst) if !tc.isErr { assert.NoError(t, err) assert.Equal(t, tc.expectedVer, ver) diff --git a/cli/util/util.go b/cli/util/util.go index 34241467c..976500e35 100644 --- a/cli/util/util.go +++ b/cli/util/util.go @@ -118,6 +118,8 @@ func JoinAbspath(paths ...string) (string, error) { } // Find find index of specified string in the slice. +// +// Deprecated: use [slices.Index] or [slices.Contains] instead. func Find(src []string, find string) int { for i, elem := range src { if find == elem { diff --git a/test/integration/ee/test_ee_uninstall.py b/test/integration/ee/test_ee_uninstall.py new file mode 100644 index 000000000..2d8e17542 --- /dev/null +++ b/test/integration/ee/test_ee_uninstall.py @@ -0,0 +1,238 @@ +#!/usr/bin/env python3 +from pathlib import Path +from shutil import copytree + +import pytest + +from utils import run_command_and_get_output + +TestDataDir = Path(__file__).parent / "testdata" + + +def prepare_testdata(program: str, case: str, tmp_path: Path) -> Path: + """Copy test case data to tmp_path directory.""" + dest_dir = tmp_path / program + copytree(TestDataDir / case / program, dest_dir, symlinks=True) + return dest_dir + + +def assert_no_extra_in_rest_files(dir: Path, rest_files: dict[str, str]) -> None: + """ + Checks that only those files that have not been deleted remain in the specified directory. + """ + for file in dir.iterdir(): + expected = rest_files.pop(file.name, None) + assert expected is not None, f"Unexpected file: {file.name} in {dir}" + if file.is_symlink(): + # Check that the symlink points to the correct target + target = file.resolve().name + assert ( + target == expected + ), f"Symlink {file.name} points to {target}, expected {expected}" + + assert ( + len(rest_files) == 0 + ), f"Missing expected files: {', '.join(rest_files.keys())}" + + +@pytest.mark.parametrize( + "program, ver_remove, rest_files", + [ + ( + "tcm", + "1.3.1-0-g074b5ffa", + { + "tcm": "tcm_1.2.0-11-g2d0a0f495", + "tcm_1.2.0-11-g2d0a0f495": "", + }, + ), + ( + "tarantool-ee", + "gc64-2.11.6-0-r683", + { + "tarantool": "tarantool-ee_gc64-3.4.0-0-r60", + "tarantool-ee_gc64-3.4.0-0-r60": "", + }, + ), + ], +) +def test_uninstall_active_version( + tt_cmd: Path, + tmp_path: Path, + program: str, + ver_remove: str, + rest_files: dict[str, str], +) -> None: + """ + Verify that the active version is removed. + For case with multiple installed versions. + """ + wort_dir = prepare_testdata(program, "2vers_installed", tmp_path) + cmd = [ + tt_cmd, + "-V", + "uninstall", + program, + ver_remove, + ] + rc, output = run_command_and_get_output(cmd, cwd=wort_dir) + + assert rc == 0 + assert "• Removing binary..." in output + assert "• Changing symlinks..." in output + assert f"• {program}={ver_remove} is uninstalled." in output + assert_no_extra_in_rest_files(wort_dir / "bin", rest_files) + + +@pytest.mark.parametrize( + "program, ver_remove, rest_files", + [ + ( + "tcm", + "1.2.0-11-g2d0a0f495", + { + "tcm": "tcm_1.3.1-0-g074b5ffa", + "tcm_1.3.1-0-g074b5ffa": "", + "tcm_2d0a0f495": "", + }, + ), + ( + "tarantool-ee", + "gc64-3.4.0-0-r60", + { + "tarantool": "tarantool-ee_gc64-2.11.6-0-r683", + "tarantool-ee_gc64-2.11.6-0-r683": "", + "tarantool_3.5.0": "", + }, + ), + ], +) +def test_uninstall_inactive_version( + tt_cmd: Path, + tmp_path: Path, + program: str, + ver_remove: str, + rest_files: dict[str, str], +) -> None: + """ + Verify that the inactive version is removed. + For case with multiple installed versions. + Active version should be same after uninstalling. + """ + wort_dir = prepare_testdata(program, "3vers_installed", tmp_path) + cmd = [ + tt_cmd, + "-V", + "uninstall", + program, + ver_remove, + ] + rc, output = run_command_and_get_output(cmd, cwd=wort_dir) + + assert rc == 0 + assert "• Removing binary..." in output + assert "• Changing symlinks..." not in output + assert f"• {program}={ver_remove} is uninstalled." in output + assert_no_extra_in_rest_files(wort_dir / "bin", rest_files) + + +@pytest.mark.parametrize( + "program, ver_remove, rest_files", + [ + ( + "tcm", + "1.3.1-0-g074b5ffa", + { + "tcm": "tcm_1.2.0-11-g2d0a0f495", + "tcm_2d0a0f495": "", + "tcm_1.2.0-11-g2d0a0f495": "", + }, + ), + ( + "tarantool-ee", + "gc64-2.11.6-0-r683", + { + "tarantool": "tarantool_3.5.0", + "tarantool_3.5.0": "", + "tarantool-ee_gc64-3.4.0-0-r60": "", + }, + ), + ], +) +def test_uninstall_switch_version( + tt_cmd: Path, + tmp_path: Path, + program: str, + ver_remove: str, + rest_files: dict[str, str], +) -> None: + """ + Verify that the active version is removed. + For case with multiple installed versions. + """ + wort_dir = prepare_testdata(program, "3vers_installed", tmp_path) + cmd = [ + tt_cmd, + "-V", + "uninstall", + program, + ver_remove, + ] + rc, output = run_command_and_get_output(cmd, cwd=wort_dir) + + assert rc == 0 + assert "• Removing binary..." in output + assert "• Changing symlinks..." in output + assert f"• {program}={ver_remove} is uninstalled." in output + assert_no_extra_in_rest_files(wort_dir / "bin", rest_files) + + +@pytest.mark.parametrize( + "program", + ["tcm", "tarantool-ee"], +) +def test_uninstall_no_version(tt_cmd: Path, tmp_path: Path, program: str) -> None: + """ + If multiple versions are installed and no version to uninstall is specified, + the `uninstall` command should generate an error. + """ + wort_dir = prepare_testdata(program, "2vers_installed", tmp_path) + + cmd = [ + tt_cmd, + "uninstall", + program, + ] + rc, output = run_command_and_get_output(cmd, cwd=wort_dir) + + assert rc == 1 + assert ( + f"⨯ {program} has more than one installed version, " + "please specify the version to uninstall" + ) in output + + +@pytest.mark.parametrize( + "program", + ["tcm", "tarantool-ee"], +) +def test_uninstall_no_active(tt_cmd: Path, tmp_path: Path, program: str) -> None: + """ + Check that if there is no active version and there are several installed versions, + the `uninstall` command will generate an error. + """ + wort_dir = prepare_testdata(program, "2vers_installed_no_active", tmp_path) + + cmd = [ + tt_cmd, + "-V", + "uninstall", + program, + ] + rc, output = run_command_and_get_output(cmd, cwd=wort_dir) + + assert rc == 1 + assert ( + f"⨯ {program} has more than one installed version, " + "please specify the version to uninstall" + ) in output diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool new file mode 120000 index 000000000..8cb7b014e --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool @@ -0,0 +1 @@ +tarantool-ee_gc64-2.11.6-0-r683 \ No newline at end of file diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool b/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool new file mode 120000 index 000000000..8cb7b014e --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool @@ -0,0 +1 @@ +tarantool-ee_gc64-2.11.6-0-r683 \ No newline at end of file diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep b/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep b/test/integration/ee/testdata/2vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/2vers_installed/tarantool-ee/tt.yaml b/test/integration/ee/testdata/2vers_installed/tarantool-ee/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tarantool-ee/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include" diff --git a/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm new file mode 120000 index 000000000..e9835dbf2 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm @@ -0,0 +1 @@ +tcm_1.3.1-0-g074b5ffa \ No newline at end of file diff --git a/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed/tcm/tt.yaml b/test/integration/ee/testdata/2vers_installed/tcm/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed/tcm/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include" diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/tt.yaml b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tarantool-ee/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include" diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.2.0-11-g2d0a0f495 b/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.2.0-11-g2d0a0f495 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.2.0-11-g2d0a0f495 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.3.1-0-g074b5ffa b/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.3.1-0-g074b5ffa new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tcm/bin/tcm_1.3.1-0-g074b5ffa @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/2vers_installed_no_active/tcm/tt.yaml b/test/integration/ee/testdata/2vers_installed_no_active/tcm/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/2vers_installed_no_active/tcm/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include" diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool new file mode 120000 index 000000000..8cb7b014e --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool @@ -0,0 +1 @@ +tarantool-ee_gc64-2.11.6-0-r683 \ No newline at end of file diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-2.11.6-0-r683 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool-ee_gc64-3.4.0-0-r60 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool_3.5.0 b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool_3.5.0 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/bin/tarantool_3.5.0 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool b/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool new file mode 120000 index 000000000..8cb7b014e --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool @@ -0,0 +1 @@ +tarantool-ee_gc64-2.11.6-0-r683 \ No newline at end of file diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep b/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-2.11.6-0-r683/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep b/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool-ee_gc64-3.4.0-0-r60/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool_3.5.0/.gitkeep b/test/integration/ee/testdata/3vers_installed/tarantool-ee/include/include/tarantool_3.5.0/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/ee/testdata/3vers_installed/tarantool-ee/tt.yaml b/test/integration/ee/testdata/3vers_installed/tarantool-ee/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tarantool-ee/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include" diff --git a/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm new file mode 120000 index 000000000..e9835dbf2 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm @@ -0,0 +1 @@ +tcm_1.3.1-0-g074b5ffa \ No newline at end of file diff --git a/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.2.0-11-g2d0a0f495 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_1.3.1-0-g074b5ffa @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_2d0a0f495 b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_2d0a0f495 new file mode 100755 index 000000000..1a2485251 --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tcm/bin/tcm_2d0a0f495 @@ -0,0 +1 @@ +#!/bin/sh diff --git a/test/integration/ee/testdata/3vers_installed/tcm/tt.yaml b/test/integration/ee/testdata/3vers_installed/tcm/tt.yaml new file mode 100644 index 000000000..feb61714d --- /dev/null +++ b/test/integration/ee/testdata/3vers_installed/tcm/tt.yaml @@ -0,0 +1,3 @@ +env: + bin_dir: "bin" + inc_dir: "include"