utils

package
v0.0.0-...-73d3301 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Overview

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

utils add features to make the test life easier

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config file path is a mandatory parameter
	ErrConfigFileUndefined = errors.New("Config file path undefined")
)

List of possible errors in this test. There can be also other errors from low level structures

View Source
var (
	TestName string
)

Functions

func BuildHTTPHeader

func BuildHTTPHeader(r *http.Request, content []byte)

func ClearDatabase

func ClearDatabase(database *mgo.Database)

Function created to remove all entries from the database to ensure that the tests enviroments are always equal

func CompareDomain

func CompareDomain(d1, d2 model.Domain) bool

Function to compare if two domains are equal, cannot use operator == because of the slices inside the domain object

func CompareProtocolDomain

func CompareProtocolDomain(d1, d2 protocol.DomainResponse) bool

Function to compare if two domains are equal, cannot use operator == because of the slices inside the domain object

func CompareProtocolDomains

func CompareProtocolDomains(d1, d2 protocol.DomainsResponse) bool

Function to compare if two domain lists are equal, cannot use operator == because of the slices inside the domain object

func CompareProtocolLinks(l1 []protocol.Link, l2 []protocol.Link) bool

func CompareProtocolScan

func CompareProtocolScan(s1, s2 protocol.ScanResponse) bool

func CompareProtocolScans

func CompareProtocolScans(s1, s2 protocol.ScansResponse) bool

func CompareScan

func CompareScan(s1, s2 model.Scan) bool

func ConvertKeyAlgorithm

func ConvertKeyAlgorithm(algorithm uint8) model.DSAlgorithm

func Errorln

func Errorln(message string, err error)

Function only to add the test name before the log message. This is useful when you have many tests running and logging in the same file, like in a continuous deployment scenario. Prints an error message without ending the test

func Fatalln

func Fatalln(message string, err error)

Function only to add the test name before the log message. This is useful when you have many tests running and logging in the same file, like in a continuous deployment scenario. Prints an error message and ends the test

func GenerateKSKAndSignZone

func GenerateKSKAndSignZone(zone string) (*dns.DNSKEY, *dns.RRSIG, error)

func GenerateKey

func GenerateKey() (*dns.DNSKEY, dns.PrivateKey, error)

We don't specify a zone for the DNSKEY because we want to reuse the same key in many different zones (performance tests)

func GenerateZSKAndSignZone

func GenerateZSKAndSignZone(zone string) (*dns.DNSKEY, *dns.RRSIG, error)

func PrintProgress

func PrintProgress(label string, percentage int)

Function to allow printing a percentage inline, that is, replacing the last percentage with the new one. You should always use this method until we got 100%, or you will miss the breaking line and the text after the percentage will be mess up

func Println

func Println(message string)

Function only to add the test name before the log message. This is useful when you have many tests running and logging in the same file, like in a continuous deployment scenario. Prints a simple message without ending the test

func ReadConfigFile

func ReadConfigFile(configFilePath string, config interface{}) error

Function to read the configuration file

func SignKey

func SignKey(zone string, dnskey *dns.DNSKEY, privateKey dns.PrivateKey) (*dns.RRSIG, error)

func StartCPUProfile

func StartCPUProfile(name string) func()

Initialize CPU profile. This function will return a function that MUST be defered to the end of the report test. If something goes wrong, the funciton will abort the program

func StartDNSServer

func StartDNSServer(port int, udpMaxSize uint16) (server *dns.Server)

func StartGoRoutinesProfile

func StartGoRoutinesProfile(name string) func()

Initialize Go Routines profile. This function will return a function that MUST be defered to the end of the report test. If something goes wrong, the funciton will abort the program

func StartMailServer

func StartMailServer(port int) (chan *mail.Message, chan error, error)

func StartMemoryProfile

func StartMemoryProfile(name string) func()

Initialize Memory profile. This function will return a function that MUST be defered to the end of the report test. If something goes wrong, the funciton will abort the program

func StartRESTServer

func StartRESTServer() func()

func StartWebClient

func StartWebClient()

func WriteReport

func WriteReport(reportFile string, report string)

If we found a report file in the current path, rename it so we don't lose the old data. We are going to use the modification date from the file. We also don't check the errors because we really don't care

Types

This section is empty.

Jump to

Keyboard shortcuts

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