Documentation ¶
Index ¶
- Constants
- Variables
- func GetDPNWorkItems() (*context.Context, []*apt_models.WorkItem, error)
- func MakeDPNBag() *models.DPNBag
- func MakeDPNNode() *models.Node
- func MakeDPNStoredFile() *models.DPNStoredFile
- func MakeFixityCheck(bagUUID, node string) *models.FixityCheck
- func MakeIngest(bagUUID string) *models.Ingest
- func MakeMessageDigest(bagUUID, node string) *models.MessageDigest
- func MakeNsqMessage(body string) *nsq.Message
- func MakeRestoreRequest(fromNode, toNode, bagUuid string) *models.RestoreTransfer
- func MakeXferRequest(fromNode, toNode, bagUuid string) *models.ReplicationTransfer
Constants ¶
const DPN_TEST_BAG_FIXITY = "fbcf91342bdd894fb55f2820dc2fce392d527ea60fd691dbef066477489820ef"
This is the sha-256 checksum of the DPN test bag's tagmanifest-sha256.txt file.
const DPN_TEST_BAG_SIZE = uint64(61952)
const DPN_TEST_BAG_UUID = "a9f7cbab-b531-4eb7-b532-770f592629ba"
This is a valid bag used to test the DPN fixity check process. A copy of this bag appears in testdata/unit_test_bags/dpn/a9f7cbab-b531-4eb7-b532-770f592629ba.tar and in the DPN test restoration bucket at aptrust.dpn.restoration.test. If it disappears from aptrust.dpn.restoration.test, you can re-upload it from testdata/unit_test_bags/dpn/. It must have the .tar extension when uploaded to S3.
const INVALID_DPN_TEST_BAG_UUID = "020c8edd-d043-4204-a6b8-26b6fb8bda5d"
This bag in the testdata dir is missing a payload file, and has a bad checksum in the tag manifest, so should fail validation.
Variables ¶
var BAG_IDS = []string{
"00000000-0000-4000-a000-000000000001",
"00000000-0000-4000-a000-000000000002",
"00000000-0000-4000-a000-000000000003",
"00000000-0000-4000-a000-000000000004",
"00000000-0000-4000-a000-000000000005",
}
BAG_IDS match the Bag.UUID values in the DPN server cluster fixture set at dpn-server/test/fixtures/integration.
var REPLICATION_IDS = []string{
"10000000-0000-4111-a000-000000000001",
"10000000-0000-4111-a000-000000000007",
"10000000-0000-4111-a000-000000000013",
"10000000-0000-4111-a000-000000000019",
"20000000-0000-4000-a000-000000000001",
"20000000-0000-4000-a000-000000000007",
"20000000-0000-4000-a000-000000000013",
"20000000-0000-4000-a000-000000000019",
"30000000-0000-4000-a000-000000000001",
"30000000-0000-4000-a000-000000000007",
"30000000-0000-4000-a000-000000000013",
"30000000-0000-4000-a000-000000000019",
"40000000-0000-4000-a000-000000000001",
"40000000-0000-4000-a000-000000000007",
"40000000-0000-4000-a000-000000000013",
"40000000-0000-4000-a000-000000000019",
"50000000-0000-4000-a000-000000000001",
"50000000-0000-4000-a000-000000000007",
"50000000-0000-4000-a000-000000000013",
"50000000-0000-4000-a000-000000000019",
}
REPLICATION_IDS match ReplicationTransfer.ReplicationIds in the DPN cluster fixture set at dpn-server/test/fixtures/integration.
var RESTORE_IDS = []string{
"11000000-0000-4111-a000-000000000001",
"11000000-0000-4111-a000-000000000002",
"11000000-0000-4111-a000-000000000003",
"11000000-0000-4111-a000-000000000004",
"21000000-0000-4111-a000-000000000001",
"21000000-0000-4111-a000-000000000002",
"21000000-0000-4111-a000-000000000003",
"21000000-0000-4111-a000-000000000004",
"31000000-0000-4111-a000-000000000001",
"31000000-0000-4111-a000-000000000002",
"31000000-0000-4111-a000-000000000003",
"31000000-0000-4111-a000-000000000004",
"41000000-0000-4111-a000-000000000001",
"41000000-0000-4111-a000-000000000002",
"41000000-0000-4111-a000-000000000003",
"41000000-0000-4111-a000-000000000004",
"51000000-0000-4111-a000-000000000001",
"51000000-0000-4111-a000-000000000002",
"51000000-0000-4111-a000-000000000003",
"51000000-0000-4111-a000-000000000004",
}
RESTORE_IDS match RestorationTransfer.RestoreIds in the DPN cluster fixture set at dpn-server/test/fixtures/integration.
Functions ¶
func GetDPNWorkItems ¶
func GetDPNWorkItems() (*context.Context, []*apt_models.WorkItem, error)
GetDPNWorkItems returns WorkItems whose action="DPN". This is used in a number of DPN post tests in the integration/ directory.
func MakeDPNNode ¶
MakeDPNNode creates a mock DPN node object for testing.
func MakeDPNStoredFile ¶
func MakeDPNStoredFile() *models.DPNStoredFile
func MakeFixityCheck ¶
func MakeFixityCheck(bagUUID, node string) *models.FixityCheck
MakeFixityCheck creates a DPN FixityCheck object for testing.
func MakeIngest ¶
MakeIngest creates a new DPN Ingest object for testing.
func MakeMessageDigest ¶
func MakeMessageDigest(bagUUID, node string) *models.MessageDigest
MakeMessageDigest creates a DPN MessageDigest object for testing.
func MakeNsqMessage ¶
func MakeNsqMessage(body string) *nsq.Message
MakeNsqMessage creates an NSQ Message with the specified body. For our purposes, param body should be an integer in string format, like "1234" or "999".
func MakeRestoreRequest ¶
func MakeRestoreRequest(fromNode, toNode, bagUuid string) *models.RestoreTransfer
MakeRestoreRequest creates a DPN RestoreTransfer object.
func MakeXferRequest ¶
func MakeXferRequest(fromNode, toNode, bagUuid string) *models.ReplicationTransfer
MakeXferRequest creates a DPN ReplicationTransfer object.
Types ¶
This section is empty.