Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error messages in validation cgroup tests #605

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions validation/linux_cgroups_cpus.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func main() {
return err
}
if *lcd.Shares != shares {
return fmt.Errorf("cpus shares limit is not set correctly, expect: %d, actual: %d", shares, lcd.Shares)
return fmt.Errorf("cpus shares limit is not set correctly, expect: %d, actual: %d", shares, *lcd.Shares)
}
if *lcd.Quota != quota {
return fmt.Errorf("cpus quota is not set correctly, expect: %d, actual: %d", quota, lcd.Quota)
return fmt.Errorf("cpus quota is not set correctly, expect: %d, actual: %d", quota, *lcd.Quota)
}
if *lcd.Period != period {
return fmt.Errorf("cpus period is not set correctly, expect: %d, actual: %d", period, lcd.Period)
return fmt.Errorf("cpus period is not set correctly, expect: %d, actual: %d", period, *lcd.Period)
}
if lcd.Cpus != cpus {
return fmt.Errorf("cpus cpus is not set correctly, expect: %s, actual: %s", cpus, lcd.Cpus)
Expand Down
2 changes: 1 addition & 1 deletion validation/linux_cgroups_hugetlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func main() {
page := "1GB"
var limit uint64 = 56892210544640
var limit uint64 = 52985 * 1024 * 1024 * 1024 // multiple of hugepage size
g := util.GetDefaultGenerator()
g.SetLinuxCgroupsPath(cgroups.AbsCgroupPath)
g.AddLinuxResourcesHugepageLimit(page, limit)
Expand Down
4 changes: 2 additions & 2 deletions validation/util/linux_resources_blkio.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ func ValidateLinuxResourcesBlockIO(config *rspec.Spec, state *rspec.State) error
}

t.Ok(*lbd.Weight == *config.Linux.Resources.BlockIO.Weight, "blkio weight is set correctly")
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.BlockIO.Weight, lbd.Weight)
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.BlockIO.Weight, *lbd.Weight)

t.Ok(*lbd.LeafWeight == *config.Linux.Resources.BlockIO.LeafWeight, "blkio leafWeight is set correctly")
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.BlockIO.LeafWeight, lbd.LeafWeight)
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.BlockIO.LeafWeight, *lbd.LeafWeight)

for _, device := range config.Linux.Resources.BlockIO.WeightDevice {
found := false
Expand Down
2 changes: 1 addition & 1 deletion validation/util/linux_resources_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func ValidateLinuxResourcesNetwork(config *rspec.Spec, state *rspec.State) error
}

t.Ok(*lnd.ClassID == *config.Linux.Resources.Network.ClassID, "network ID set correctly")
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.Network.ClassID, lnd.ClassID)
t.Diagnosticf("expect: %d, actual: %d", *config.Linux.Resources.Network.ClassID, *lnd.ClassID)

for _, priority := range config.Linux.Resources.Network.Priorities {
found := false
Expand Down