test

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestJSON string = `` /* 2602-byte string literal not displayed */

ManifestJSON is a test manifest

View Source
const UpdateManifest = `{
	"Packages": {
		"frontend": {
			"SecurityVersion": 5
		}
	}
}`

UpdateManifest is a test update manifest

Variables

View Source
var AdminCert = mustGenerateAdminTestCert(RecoveryPrivateKey)

AdminCert is an automatically generated test certificate used for unit tests for API features needing additional authentication.

View Source
var IntegrationManifestJSON string = `{
	"Packages": {
		"backend": {
			"Debug": true,
			"SecurityVersion": 1,
			"ProductID": 3
		},
		"frontend": {
			"Debug": true,
			"SecurityVersion": 2,
			"ProductID": 3
		}
	},
	"Infrastructures": {
		"Azure": {
			"QESVN": 2,
			"PCESVN": 3,
			"CPUSVN": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
			"RootCA": [3,3,3]
		}
	},
	"Marbles": {
		"test_marble_server": {
			"Package": "backend",
			"Parameters": {
				"Files": {
					"/tmp/coordinator_test/defg.txt": "foo",
					"/tmp/coordinator_test/jkl.mno": "bar"
				},
				"Argv": [
					"./marble",
					"serve"
				],
				"Env": {
					"IS_FIRST": "true",
					"SEAL_KEY": "{{ hex .Marblerun.SealKey }}"
			}
			}
		},
		"test_marble_client": {
			"Package": "backend",
			"Parameters": {
				"Files": {
					"/tmp/coordinator_test/defg.txt": "foo",
					"/tmp/coordinator_test/jkl.mno": "bar"
				},
				"Env": {
					"IS_FIRST": "true",
					"SEAL_KEY": "{{ hex .Marblerun.SealKey }}"
			}
			}
		},
		"bad_marble": {
			"Package": "frontend",
			"Parameters": {
				"Files": {
					"/tmp/coordinator_test/defg.txt": "foo",
					"/tmp/coordinator_test/jkl.mno": "bar"
				},
				"Env": {
					"SEAL_KEY": "{{ hex .Marblerun.SealKey }}"
			}
		}
		}
	},
	"Clients": {
		"owner": [9,9,9]
	},
	"Admins": {
		"admin": "` + pemToJSONString(AdminCert) + `"
	},
	"RecoveryKeys": {
		"testRecKey1": "` + pemToJSONString(RecoveryPublicKey) + `"
	}
}`

IntegrationManifestJSON is a test manifest

View Source
var ManifestJSONMissingParameters string = `` /* 398-byte string literal not displayed */

ManifestJSONMissingParameters is a test manifest

View Source
var ManifestJSONWithRecoveryKey string = `{
	"Packages": {
		"frontend": {
			"SignerID": "1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100",
			"ProductID": 44,
			"SecurityVersion": 3,
			"Debug": true
		}
	},
	"Infrastructures": {
		"Azure": {
			"QESVN": 2,
			"PCESVN": 3,
			"CPUSVN": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
			"RootCA": [3,3,3]
		}
	},
	"Marbles": {
		"frontend": {
			"Package": "frontend",
			"Parameters": {
				"Env": {
					"SEAL_KEY": "{{ hex .Marblerun.SealKey }}"
				}
			}
		}
	},
	"Clients": {
		"owner": [9,9,9]
	},
	"Admins": {
		"admin": "` + pemToJSONString(AdminCert) + `"
	},
	"RecoveryKeys": {
		"testRecKey1": "` + pemToJSONString(RecoveryPublicKey) + `"
	}
}`

ManifestJSONWithRecoveryKey is a test manifest with a dynamically generated RSA key

View Source
var RecoveryPublicKey, RecoveryPrivateKey = generateTestRecoveryKey()

Functions

func MustSetupTestCerts added in v0.3.0

func MustSetupTestCerts(key *rsa.PrivateKey) (*x509.Certificate, *x509.Certificate)

MustSetupTestCerts can be used by other unit tests to test authentication features, in which one certificate matches the generated admin certificate, and the other is just a randomly generated one

Types

This section is empty.

Jump to

Keyboard shortcuts

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