Rebrand the project from Fence to Greywall, the sandboxing layer of the GreyHaven platform. This updates: - Go module path to gitea.app.monadical.io/monadical/greywall - Binary name, CLI help text, and all usage examples - Config paths (~/.config/greywall/greywall.json), env vars (GREYWALL_*) - Log prefixes ([greywall:*]), temp file prefixes (greywall-*) - All documentation, scripts, CI workflows, and example files - README rewritten with GreyHaven branding and Fence attribution Directory/file renames: cmd/fence → cmd/greywall, pkg/fence → pkg/greywall, docs/why-fence.md → docs/why-greywall.md, example JSON files, and banner.
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package sandbox
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.app.monadical.io/monadical/greywall/internal/config"
|
|
)
|
|
|
|
// TestLinux_NoProxyBlocksNetwork verifies that when no ProxyURL is set,
|
|
// the Linux sandbox uses --unshare-net to block all network access.
|
|
func TestLinux_NoProxyBlocksNetwork(t *testing.T) {
|
|
cfg := &config.Config{
|
|
Network: config.NetworkConfig{},
|
|
Filesystem: config.FilesystemConfig{
|
|
AllowWrite: []string{"/tmp/test"},
|
|
},
|
|
}
|
|
|
|
// With no proxy, network should be blocked
|
|
if cfg.Network.ProxyURL != "" {
|
|
t.Error("expected empty ProxyURL for no-network config")
|
|
}
|
|
}
|
|
|
|
// TestLinux_ProxyURLSet verifies that a proxy URL is properly set in config.
|
|
func TestLinux_ProxyURLSet(t *testing.T) {
|
|
cfg := &config.Config{
|
|
Network: config.NetworkConfig{
|
|
ProxyURL: "socks5://localhost:1080",
|
|
},
|
|
Filesystem: config.FilesystemConfig{
|
|
AllowWrite: []string{"/tmp/test"},
|
|
},
|
|
}
|
|
|
|
if cfg.Network.ProxyURL != "socks5://localhost:1080" {
|
|
t.Errorf("expected ProxyURL socks5://localhost:1080, got %s", cfg.Network.ProxyURL)
|
|
}
|
|
}
|