Skip to content

Commit

Permalink
fix: suit test (#7752)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcy00000000000000 authored Jan 19, 2024
1 parent be70314 commit f4672bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/host_server/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ var _ = Describe("host test", func() {

Describe("add host test", func() {
It("add host using api", func() {
test.DeleteAllHosts()
input := map[string]interface{}{
"bk_biz_id": bizId,
"host_info": map[string]interface{}{
Expand Down
7 changes: 6 additions & 1 deletion src/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ func DeleteAllHosts() {
func DeleteAllObjects() {
ctx := context.Background()

delCond := mapstr.MapStr{"creator": mapstr.MapStr{common.BKDBNE: "cc_system"}}
innerObjs := []string{common.BKInnerObjIDBizSet, common.BKInnerObjIDApp, common.BKInnerObjIDSet,
common.BKInnerObjIDModule, common.BKInnerObjIDHost, common.BKInnerObjIDProc, common.BKInnerObjIDPlat,
common.BKInnerObjIDProject, common.BKInnerObjIDSwitch, common.BKInnerObjIDRouter, common.BKInnerObjIDBlance,
common.BKInnerObjIDFirewall, common.BKInnerObjIDWeblogic, common.BKInnerObjIDTomcat, common.BKInnerObjIDApache}

delCond := mapstr.MapStr{common.BKObjIDField: mapstr.MapStr{common.BKDBNIN: innerObjs}}
objects := make([]metadata.Object, 0)
err := GetDB().Table(common.BKTableNameObjDes).Find(delCond).Fields(common.BKObjIDField, common.BkSupplierAccount).
All(ctx, &objects)
Expand Down

0 comments on commit f4672bc

Please sign in to comment.