提交 74efa10a 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!11 Add testcase for GetDiskUsageStats

Merge pull request !11 from wangfengtu/unit_test_for_disk_usage
......@@ -65,13 +65,24 @@ static: link
unit-test: link
echo $(GOPATH)
echo $(CURDIR)
go test -v github.com/containers/storage/drivers/devmapper
rm -rf $(CURDIR)/src/isula-image
mkdir -p $(CURDIR)/src/isula-image/cmd
cp -rf $(CURDIR)/cmd/isulad_img $(CURDIR)/src/isula-image/cmd/
cp -rf $(CURDIR)/isula $(CURDIR)/src/isula-image/
mkdir -p ${GOTMPDIR}
$(GPGME_ENV) go test ${GO_DYN_FLAGS} -ldflags "-extldflags -zrelro -extldflags -znow -tmpdir ${GOTMPDIR} -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -v -coverpkg=github.com/containers/storage/drivers/devmapper github.com/containers/storage/drivers/devmapper
$(GPGME_ENV) go test ${GO_DYN_FLAGS} -ldflags "-extldflags -zrelro -extldflags -znow -tmpdir ${GOTMPDIR} -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -v -coverpkg=isula-image/cmd/isulad_img isula-image/cmd/isulad_img
rm -rf ${GOTMPDIR}
rm -rf $(CURDIR)/src/isula-image
rm -f $(CURDIR)/src
proto:
protoc --go_out=plugins=grpc:. ./isula/isula_image.proto
clean:
rm -rf ${ISULAD_KIT_BIN}
rm -rf $(CURDIR)/src/isula-image
rm -f $(CURDIR)/src
install:
install -d -m 755 ${INSTALLDIR}
......
......@@ -12,6 +12,7 @@
// Create: 2019-05-06
// +build !containers_image_openpgp
package main
// #cgo LDFLAGS: -lgpgme
......
// Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
// iSulad-img licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
// PURPOSE.
// See the Mulan PSL v1 for more details.
// Description: iSulad image kit
// Author: wangfengtu
// Create: 2020-02-25
package main
import (
"testing"
)
func TestGetDiskUsageStats(t *testing.T) {
// Make sure it do not panic
_, _, err := GetDiskUsageStats("/proc")
if err != nil {
t.Errorf("GetDiskUsageStats failed: %v", err)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册