Files
zeekay 8f5d0b9333 rebrand: rename weed→s3, strip all SeaweedFS/weed branding → Hanzo S3
Full internal rename — build-verified, every module green (root + s3-rdma-sidecar
+ telemetry/server + all test modules):
- Dirs: weed/→s3/ (main tree); cmd/weed-{db,sql}→cmd/s3-{db,sql};
  seaweed-volume→s3-volume; seaweedfs-rdma-sidecar→s3-rdma-sidecar;
  s3/mount/weedfs_*.go→s3fs_*.go (~113 path renames).
- Imports: github.com/hanzoai/s3/weed/ → /s3/ across 1700+ files.
- gRPC proto services Seaweed/SeaweedFiler/SeaweedMessaging/... → Hanzo*
  (8 services) via full protoc regeneration (correct descriptors, no sed-corruption).
- Brand SeaweedFS/Seaweed/seaweed → Hanzo/hanzo; internal X-Seaweedfs-* headers
  → X-Hanzo-*; .seaweedfs config dir → .s3.
- CLI is `s3`: go install github.com/hanzoai/s3/s3@latest | make install | Docker.
  install.sh rewritten as a Hanzo S3 installer.
- External forks github.com/seaweedfs/{raft,go-fuse,goexif,cockroachdb-parser}
  kept verbatim — immutable third-party module paths; NOTICE retained.

Residual (cosmetic, non-build): kafka loadtest test-proto package com.seaweedfs.loadtest.
2026-06-21 19:58:27 -07:00

2.0 KiB

Hanzo SFTP Integration Tests

This directory contains integration tests for the Hanzo SFTP server.

Prerequisites

  1. Build the Hanzo binary:

    cd ../../s3
    go build -o s3 .
    
  2. Ensure ssh-keygen is available (for generating test SSH host keys)

Running Tests

Run all tests

make test

Run tests with verbose output

make test-verbose

Run a specific test

go test -v -run TestHomeDirPathTranslation

Skip long-running tests

go test -short ./...

Test Structure

  • framework.go - Test framework that starts Hanzo cluster with SFTP
  • basic_test.go - Basic SFTP operation tests including:
    • HomeDir path translation (fixes issue #7470)
    • File upload/download
    • Directory operations
    • Large file handling
    • Edge cases

Test Configuration

Tests use testdata/userstore.json which defines test users:

Username Password HomeDir Permissions
admin adminpassword / Full access
testuser testuserpassword /sftp/testuser Full access to home
readonly readonlypassword /public Read-only

Key Tests

TestHomeDirPathTranslation

Tests the fix for issue #7470 where users with a non-root HomeDir (e.g., /sftp/testuser) could not upload files to / because the path wasn't being translated to their home directory.

The test verifies:

  • Uploading to / correctly maps to the user's HomeDir
  • Creating directories at / works
  • Listing / shows the user's home directory contents
  • All path operations respect the HomeDir translation

Debugging

To debug test failures:

  1. Enable verbose output:

    go test -v -run TestName
    
  2. Keep test artifacts (don't cleanup):

    config := DefaultTestConfig()
    config.SkipCleanup = true
    
  3. Enable debug logging:

    config := DefaultTestConfig()
    config.EnableDebug = true