Ejemplo n.º 1
0
func ReadRelease(pf, sf, cif string) {
	cid, err := CommitScanner(cif)
	if err != nil {
		dbg.Panic("Cannot read commitid corresponding to the release")
	} else {
		Releases[cid] = CommitEntry{pf, sf, false}
		dbg.Lvl3("Added a new entry to release table")
	}

}
Ejemplo n.º 2
0
func TestVerification(t *testing.T) {
	dbg.TestOutput(testing.Verbose(), 4)
	var (
		PolicyFile     = "example/policy.txt"
		SignaturesFile = "example/signatures.txt"
		CommitIdFile   = "example/commitid.txt"
	)

	commitId, _ := CommitScanner(CommitIdFile)
	decision, err := ApprovalCheck(PolicyFile, SignaturesFile, commitId)
	if err != nil {
		dbg.Panic("Problem with verifying approval of developers", err)
	}

	// dbg.Printf("How many signatures have been read? %+v", len(co.Signatures))
	// dbg.Printf("What is a threshold value? %+v", co.Policy.Threshold)
	dbg.Printf("Is commit approved? %+v", decision)
}