Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions free/pentest-kit/cmd/pentest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package main
// These tests run offline — no network, no plugin, no Hasura.

import (
"os"
"testing"
)

Expand Down Expand Up @@ -137,13 +136,8 @@ func TestRequirePentestKit_OwnerKeyAccepted(t *testing.T) {
// is read from the environment (the primary license env var path).
func TestRequirePentestKit_OwnerLicenseEnvVar(t *testing.T) {
t.Setenv("NSELF_PENTEST_KIT", "true")
// NSELF_OWNER_LICENSE_KEY is the owner vault variable; simulate it via the
// NSELF_PLUGIN_LICENSE_KEY env var which license.GetKey() checks first.
ownerKey := os.Getenv("NSELF_PLUGIN_LICENSE_KEY_OWNER")
if ownerKey == "" {
ownerKey = "nself_owner_abcdefghijklmnopqrstuvwxyz1234"
}
t.Setenv("NSELF_PLUGIN_LICENSE_KEY", ownerKey)
// A fixed fixture only: a real owner key must never reach a test (X-18).
t.Setenv("NSELF_PLUGIN_LICENSE_KEY", "nself_owner_abcdefghijklmnopqrstuvwxyz1234")

err := requirePentestKit()
if err != nil {
Expand Down
Loading