amtest

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateOrgStmt = `` /* 619-byte string literal not displayed */

	CreateUserStmt      = `` /* 167-byte string literal not displayed */
	CreateScanGroupStmt = `` /* 250-byte string literal not displayed */

	CreateAddressStmt = `` /* 535-byte string literal not displayed */

	DeleteOrgStmt  = "select am.delete_org((select organization_id from am.organizations where organization_name=$1))"
	DeleteUserStmt = "delete from am.users where organization_id=(select organization_id from am.organizations where organization_name=$1)"
	GetOrgIDStmt   = "select organization_id from am.organizations where organization_name=$1"
	GetUserIDStmt  = "select user_id from am.users where organization_id=$1 and email=$2"
	GetUserStmt    = `` /* 225-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func AddrsFromInputFile

func AddrsFromInputFile(orgID, groupID int, addrFile io.Reader, t *testing.T) []*am.ScanGroupAddress

func BuildCTRecords

func BuildCTRecords(etld string, insertedTS int64, count int) map[string]*am.CTRecord

func BuildSubdomainsForCT

func BuildSubdomainsForCT(etld string, count int) map[string]*am.CTSubdomain

func CreateAddressOnly

func CreateAddressOnly(orgID, groupID int, ipAddress, hostAddress string, t *testing.T) *am.ScanGroupAddress

func CreateEnterpriseOrg

func CreateEnterpriseOrg(p *pgx.ConnPool, name string, t *testing.T)

func CreateMediumOrg

func CreateMediumOrg(p *pgx.ConnPool, name string, t *testing.T)

func CreateModuleConfig

func CreateModuleConfig() *am.ModuleConfiguration

func CreateMultiWebData

func CreateMultiWebData(address *am.ScanGroupAddress, host, ip string) []*am.WebData

func CreateMultiWebDataWithSub

func CreateMultiWebDataWithSub(address *am.ScanGroupAddress, host, ip string, total int) []*am.WebData

func CreateOrg

func CreateOrg(p *pgx.ConnPool, name string, t *testing.T)

func CreateOrgFromOrg

func CreateOrgFromOrg(p *pgx.ConnPool, org *am.Organization, t *testing.T)

func CreateOrgInstance

func CreateOrgInstance(orgName string) *am.Organization

func CreateScanGroup

func CreateScanGroup(p *pgx.ConnPool, orgName, groupName string, t *testing.T) int

func CreateScanGroupAddress

func CreateScanGroupAddress(p *pgx.ConnPool, orgID, groupID int, t *testing.T) *am.ScanGroupAddress

func CreateScanGroupAddressWithAddress

func CreateScanGroupAddressWithAddress(p *pgx.ConnPool, a *am.ScanGroupAddress, t *testing.T) int64

func CreateScanGroupOnly

func CreateScanGroupOnly(orgID, groupID int) *am.ScanGroup

func CreateSmallOrg

func CreateSmallOrg(p *pgx.ConnPool, name string, t *testing.T)

func CreateUserContext

func CreateUserContext(orgID, userID int) *mock.UserContext

func CreateWebData

func CreateWebData(address *am.ScanGroupAddress, host, ip string) *am.WebData

func DeleteOrg

func DeleteOrg(p *pgx.ConnPool, name string, t *testing.T)

func Float32EqualEPS

func Float32EqualEPS(a, b float32, eps float32) bool

func Float32Equals

func Float32Equals(a, b float32) bool

func Float64EqualEPS

func Float64EqualEPS(a, b float64, eps float64) bool

func Float64Equals

func Float64Equals(a, b float64) bool

func GenerateAddrs

func GenerateAddrs(orgID, groupID, count int) []*am.ScanGroupAddress

func GenerateID

func GenerateID(t *testing.T) string

func GetOrgID

func GetOrgID(p *pgx.ConnPool, name string, t *testing.T) int

func GetUser

func GetUser(p *pgx.ConnPool, orgID int, name string, t *testing.T) *am.User

func GetUserId

func GetUserId(p *pgx.ConnPool, orgID int, name string, t *testing.T) int

func InitDB

func InitDB(env string, t *testing.T) *pgx.ConnPool

func MockAddressService

func MockAddressService(orgID int, addresses []*am.ScanGroupAddress) *mock.AddressService

func MockAuthorizer

func MockAuthorizer() *mock.Authorizer

func MockBigDataState

func MockBigDataState() *mock.BigDataState

func MockBigQueryClient

func MockBigQueryClient() *mock.BigQuerier

func MockBruteState

func MockBruteState() *mock.BruteState

func MockCertListener

func MockCertListener() *mock.CertListener

func MockDispatcherState

func MockDispatcherState(wg *sync.WaitGroup, groups []*am.ScanGroup) *mock.DispatcherState

func MockEmptyAuthorizer

func MockEmptyAuthorizer() *mock.Authorizer

func MockEventService

func MockEventService() *mock.EventService

func MockNSState

func MockNSState() *mock.NSState

func MockPortScanService

func MockPortScanService(orgID, groupID int, ports []int32) *mock.PortScannerService

func MockRoleManager

func MockRoleManager() *mock.RoleManager

func MockScanGroupService

func MockScanGroupService(orgID, groupID int) *mock.ScanGroupService

func MockStorage

func MockStorage() *mock.Storage

func MockWebDataService

func MockWebDataService(orgID, groupID int) *mock.WebDataService

func MockWebDetector

func MockWebDetector() *mock.Detector

func MockWebState

func MockWebState() *mock.WebState

func MockWebhooker

func MockWebhooker() *mock.Webhooker

func RunAggregates

func RunAggregates(db *pgx.ConnPool, t *testing.T)

func SortEqualInt

func SortEqualInt(expected, returned []int, t *testing.T) bool

func SortEqualInt32

func SortEqualInt32(expected, returned []int32, t *testing.T) bool

func SortEqualInt64

func SortEqualInt64(expected, returned []int64, t *testing.T) bool

func SortEqualString

func SortEqualString(expected, returned []string, t *testing.T) bool

func TestCompareAddress

func TestCompareAddress(e, r *am.ScanGroupAddress, t *testing.T)

TestCompareAddress details

func TestCompareAddresses

func TestCompareAddresses(expected, returned map[string]*am.ScanGroupAddress, t *testing.T)

TestCompareAddresses tests all addresses in both maps' details

func TestCompareCTRecords

func TestCompareCTRecords(expected, returned map[string]*am.CTRecord, t *testing.T)

func TestCompareGroupModules

func TestCompareGroupModules(e, r *am.ModuleConfiguration, t *testing.T)

func TestCompareOrganizations

func TestCompareOrganizations(expected, returned *am.Organization, t *testing.T)

TestCompareOrganizations does not compare fields that are unknown prior to creation time (creation time, org id, orgcid)

func TestComparePortData

func TestComparePortData(e, r *am.PortData, t *testing.T)

func TestComparePorts

func TestComparePorts(e, r *am.PortResults, t *testing.T)

func TestComparePortsWithPrevious

func TestComparePortsWithPrevious(e, r *am.PortResults, t *testing.T)

func TestCompareScanGroup

func TestCompareScanGroup(group1, group2 *am.ScanGroup, t *testing.T)

func TestCompareWebhookSettings

func TestCompareWebhookSettings(e, r *am.WebhookEventSettings, t *testing.T)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL