浏览代码

test: bill of materials check pass

Anthony Romano 8 年之前
父节点
当前提交
b77de97136
共有 1 个文件被更改,包括 16 次插入1 次删除
  1. 16 1
      test

+ 16 - 1
test

@@ -20,7 +20,7 @@ source ./build
 etcd_setup_gopath
 etcd_setup_gopath
 
 
 if [ -z "$PASSES" ]; then
 if [ -z "$PASSES" ]; then
-	PASSES="fmt dep compile build unit"
+	PASSES="fmt bom dep compile build unit"
 fi
 fi
 
 
 # Invoke ./cover for HTML output
 # Invoke ./cover for HTML output
@@ -329,6 +329,21 @@ function fmt_pass {
 	done
 	done
 }
 }
 
 
+function bom_pass {
+	if ! which license-bill-of-materials >/dev/null; then
+		return
+	fi
+	echo "Checking bill of materials..."
+	license-bill-of-materials \
+		--override-file bill-of-materials.override.json \
+		github.com/coreos/etcd github.com/coreos/etcd/etcdctl >bom-now.json || true
+	if ! diff bill-of-materials.json bom-now.json; then
+		echo vendored licenses do not match given bill of materials
+		exit 255
+	fi
+	rm bom-now.json
+}
+
 function dep_pass {
 function dep_pass {
 	echo "Checking package dependencies..."
 	echo "Checking package dependencies..."
 	# don't pull in etcdserver package
 	# don't pull in etcdserver package