Files
seaweedfs/weed/s3api
Chris Lu 65fcf2d740 test(s3/lifecycle): direct router + engine helper coverage
Bundles direct tests for several pure helpers in router.go and
accessors on engine.Snapshot — all previously exercised only
indirectly through the larger Route* / Compile tests, where a
helper-level regression would surface as a downstream failure
that's harder to diagnose.

Router helpers:
- successorModTimeFromContainer: missing ext, empty value, non-numeric
  garbage, non-positive seconds, positive seconds round-trip
- logicalKeyFromVersionPath: extracts logical key, rejects path with
  non-.versions parent, root-level path with no real parent, no slashes
  at all, empty after trim
- isVersionsContainerKey: bucket-root .versions rejected, trailing
  .versions accepted, files inside the container rejected
- isVersionFolderPath: child of .versions accepted, container itself
  rejected, no-slash rejected; documents the trailing-slash edge
- isDeleteMarkerEntry: nil/empty extended false, only literal "true"
  matches (case-insensitive variants and "1" rejected)
- extractTags: nil/empty input returns nil, only AmzObjectTagging-
  prefixed keys surface, no-tag input returns nil (not empty map)
- hasActiveEventDrivenAction: matches only active+event-driven kinds,
  scan-only kind rejected, unknown action skipped

Engine snapshot accessors:
- BucketVersioned reflects the compiled flag, unknown bucket false
- BucketActionKeys returns all compiled keys for the bucket, unknown
  bucket nil
- Action returns nil for unknown key
- AllActions enumerates every compiled kind regardless of active state
- SnapshotID is strictly monotonic across recompiles (the dispatcher's
  stale-snapshot check depends on this)

24 tests total, all passing under -race.
2026-05-09 20:51:52 -07:00
..
2026-01-28 14:34:07 -08:00
2026-02-20 18:40:47 -08:00

see https://blog.aqwari.net/xml-schema-go/

1. go get aqwari.net/xml/cmd/xsdgen
2. Add EncodingType element for ListBucketResult in AmazonS3.xsd
3. xsdgen -o s3api_xsd_generated.go -pkg s3api AmazonS3.xsd
4. Remove empty Grantee struct in s3api_xsd_generated.go
5. Remove xmlns: sed s'/http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\ //' s3api_xsd_generated.go