forked from Plemya-x/ALR
		
	fix installing multiple packages
This commit is contained in:
		@@ -100,11 +100,11 @@ func e2eSpawn(runnable e2e.Runnable, command e2e.Command, timeout time.Duration,
 | 
			
		||||
 | 
			
		||||
var ALL_SYSTEMS []string = []string{
 | 
			
		||||
	"ubuntu-24.04",
 | 
			
		||||
	"alt-sisyphus",
 | 
			
		||||
	"archlinux",
 | 
			
		||||
	//"alpine",
 | 
			
		||||
	"opensuse-leap",
 | 
			
		||||
	"redos-8",
 | 
			
		||||
	// "alt-sisyphus",
 | 
			
		||||
	// "archlinux",
 | 
			
		||||
	// "alpine",
 | 
			
		||||
	// "opensuse-leap",
 | 
			
		||||
	// "redos-8",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var COMMON_SYSTEMS []string = []string{
 | 
			
		||||
@@ -155,6 +155,7 @@ func dockerMultipleRun(t *testing.T, name string, ids []string, f func(t *testin
 | 
			
		||||
						Volumes: []string{
 | 
			
		||||
							"./alr:/usr/bin/alr",
 | 
			
		||||
						},
 | 
			
		||||
						Privileged: true,
 | 
			
		||||
					},
 | 
			
		||||
				)
 | 
			
		||||
				assert.NoError(t, e2e.StartAndWaitReady(runnable))
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
FROM ubuntu:24.10
 | 
			
		||||
RUN apt update && apt install -y ca-certificates
 | 
			
		||||
RUN useradd -m -s /bin/bash alr-user
 | 
			
		||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates sudo
 | 
			
		||||
RUN useradd -m -s /bin/bash alr-user && \
 | 
			
		||||
    echo "alr-user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/alr-user && \
 | 
			
		||||
    chmod 0440 /etc/sudoers.d/alr-user
 | 
			
		||||
USER alr-user
 | 
			
		||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
 | 
			
		||||
							
								
								
									
										55
									
								
								e2e-tests/issue_50_install_multiple_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								e2e-tests/issue_50_install_multiple_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
// ALR - Any Linux Repository
 | 
			
		||||
// Copyright (C) 2025 Евгений Храмов
 | 
			
		||||
//
 | 
			
		||||
// 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 3 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, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
//go:build e2e
 | 
			
		||||
 | 
			
		||||
package e2etests_test
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	"github.com/alecthomas/assert/v2"
 | 
			
		||||
	"github.com/efficientgo/e2e"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestE2EIssue50InstallMultiple(t *testing.T) {
 | 
			
		||||
	dockerMultipleRun(
 | 
			
		||||
		t,
 | 
			
		||||
		"issue-50-install-multiple",
 | 
			
		||||
		COMMON_SYSTEMS,
 | 
			
		||||
		func(t *testing.T, r e2e.Runnable) {
 | 
			
		||||
			err := r.Exec(e2e.NewCommand(
 | 
			
		||||
				"alr",
 | 
			
		||||
				"addrepo",
 | 
			
		||||
				"--name",
 | 
			
		||||
				"alr-repo",
 | 
			
		||||
				"--url",
 | 
			
		||||
				"https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git",
 | 
			
		||||
			))
 | 
			
		||||
			assert.NoError(t, err)
 | 
			
		||||
 | 
			
		||||
			err = r.Exec(e2e.NewCommand(
 | 
			
		||||
				"alr", "in", "foo-pkg", "bar-pkg",
 | 
			
		||||
			))
 | 
			
		||||
			assert.NoError(t, err)
 | 
			
		||||
 | 
			
		||||
			err = r.Exec(e2e.NewCommand("cat", "/opt/foo"))
 | 
			
		||||
			assert.NoError(t, err)
 | 
			
		||||
			err = r.Exec(e2e.NewCommand("cat", "/opt/bar"))
 | 
			
		||||
			assert.NoError(t, err)
 | 
			
		||||
		},
 | 
			
		||||
	)
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user