ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/go/pkg/mod/github.com/aws/[email protected]/aws/endpoints/main_test.go
package endpoints

import (
	"fmt"
	"os"
	"path/filepath"
	"testing"
)

// Update all endpoints partition variables data to be the static testdata
// model instead of the dynamic live model. This ensures that endpoint tests
// are tested against static data, and will not break when the live
// endpoints.json model is updated.

func TestMain(m *testing.M) {
	testdataFilename := filepath.Join("testdata", "endpoints.json")

	testdataFile, err := os.Open(testdataFilename)
	if err != nil {
		panic(fmt.Sprintf("failed to open test endpoints model, %v", err))
	}

	resolver, err := DecodeModel(testdataFile)
	if err != nil {
		panic(fmt.Sprintf("failed to decode test endpoints model, %v", err))
	}

	partitions, ok := resolver.(partitions)
	if !ok {
		panic(fmt.Sprintf("expect %T resolver, got %T", partitions, resolver))
	}

	for _, p := range partitions {
		switch p.ID {
		case "aws":
			awsPartition = p
		case "aws-cn":
			awscnPartition = p
		case "aws-us-gov":
			awsusgovPartition = p
		case "aws-iso":
			awsisoPartition = p
		case "aws-iso-b":
			awsisobPartition = p
		default:
			panic("unknown endpoints partition " + p.ID)
		}
	}
}