test

package
v0.0.0-...-845c20a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DomainId        = "7b160558-8273-5a24-b559-6de3ff053c63"
	OrgId           = "123456"
	DomainName      = "ipa.test"
	RealmName       = "IPA.TEST"
	UserName        = "testuser"
	UserId          = "234"
	UserAccountNr   = "345"
	SystemAccountNr = "456"
)

Variables

View Source
var (
	DomainType   = public.RhelIdm
	DomainUUID   = uuid.MustParse(DomainId)
	RealmDomains = []string{DomainName, "otherdomain.test"}
	Location1    = public.Location{
		Name:        "sigma",
		Description: pointy.String("Location Sigma"),
	}
	Location2 = public.Location{
		Name: "tau",
	}
	IpaCaPublicCert = public.Certificate{
		Nickname:     "IPA.TEST IPA CA",
		Issuer:       "CN=Certificate Authority,O=IPA.TEST",
		Subject:      "CN=Certificate Authority,O=IPA.TEST",
		SerialNumber: "1",
		Pem:          "-----BEGIN CERTIFICATE-----\nMII...\n-----END CERTIFICATE-----\n",
		NotBefore:    time.Date(2023, 3, 21, 5, 38, 9, 0, time.UTC),
		NotAfter:     time.Date(2043, 3, 21, 5, 38, 9, 0, time.UTC),
	}
	IpaCaModelCert = model.IpaCert{
		Nickname:     IpaCaPublicCert.Nickname,
		Issuer:       IpaCaPublicCert.Issuer,
		Subject:      IpaCaPublicCert.Subject,
		SerialNumber: IpaCaPublicCert.SerialNumber,
		Pem:          IpaCaPublicCert.Pem,
		NotBefore:    IpaCaPublicCert.NotBefore,
		NotAfter:     IpaCaPublicCert.NotAfter,
	}
)
View Source
var (
	Server1 = NewTestHost(
		"server1.ipa.test",
		"21258fc8-c755-11ed-afc4-482ae3863d30",
		"547ce70c-9eb5-4783-a619-086aa26f88e5",
	)
	Server2 = NewTestHost("server2.ipa.test",
		"5b3ce177-7c02-4ccb-a3d9-037504ded64a",
		"24c82b63-4d8a-4565-b232-0b93913f0c62",
	)
	Client1 = NewTestHost("client1.ipa.test", "", "")
)

Functions

func BuildDomainModel

func BuildDomainModel(orgID string) *model.Domain

func GetSystemXRHID

func GetSystemXRHID(orgId string, commonName string, acountNumber string) identity.XRHID

Create XRHID identity for system (cert auth)

func GetTestConfig

func GetTestConfig() (cfg *config.Config)

Config for testing

func GetUserXRHID

func GetUserXRHID(orgId string, userName string, userId string, acountNumber string, admin bool) identity.XRHID

Create XRHID identity for user

func NewSqlMock

func NewSqlMock(session *gorm.Session) (sqlmock.Sqlmock, *gorm.DB, error)

Types

type TestHost

type TestHost struct {
	Fqdn          string
	CertCN        string // subscription manager cert common name
	CertUUID      uuid.UUID
	InventoryId   string
	InventoryUUID uuid.UUID
}

func NewTestHost

func NewTestHost(fqdn string, certCN string, inventoryId string) TestHost

Create a new test host certCN and inventoryId may be empty strings to generate a random UUID

Directories

Path Synopsis
Package builder to help on building data models.
Package builder to help on building data models.
api
mock
Package smoke contains all the smoke test for the service
Package smoke contains all the smoke test for the service

Jump to

Keyboard shortcuts

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