forked from AliyunContainerService/pouch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
when starting or creating containers in environments which has thousands of lines in /proc/mounts https://work.aone.alibaba-inc.com/issue/22582695 Signed-off-by: shenling.yyb <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// +build linux | ||
|
||
package quota | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/alibaba/pouch/pkg/system" | ||
) | ||
|
||
func Test_getDevID(t *testing.T) { | ||
wd, err := os.Getwd() | ||
if err != nil { | ||
t.Fatalf("get work directory error %v", err) | ||
} | ||
expectID, err := system.GetDevID(wd) | ||
if err != nil { | ||
t.Fatalf("get dev id error of %s: %v", wd, err) | ||
} | ||
|
||
gotID, err := getDevID(wd) | ||
if err != nil { | ||
t.Fatalf("get dev id error of %s by getDevID: %v", wd, err) | ||
} | ||
|
||
if expectID != gotID { | ||
t.Fatalf("getDevID error expect %d got %d", expectID, gotID) | ||
} | ||
} |