(base *Base, requiredType, requiredID string, requiredCaps []string)
| 618 | } |
| 619 | |
| 620 | func RequireContainerdPlugin(base *Base, requiredType, requiredID string, requiredCaps []string) { |
| 621 | base.T.Helper() |
| 622 | info := base.InfoNative() |
| 623 | for _, p := range info.Daemon.Plugins.Plugins { |
| 624 | if p.Type != requiredType { |
| 625 | continue |
| 626 | } |
| 627 | if p.ID != requiredID { |
| 628 | continue |
| 629 | } |
| 630 | pCapMap := make(map[string]struct{}, len(p.Capabilities)) |
| 631 | for _, f := range p.Capabilities { |
| 632 | pCapMap[f] = struct{}{} |
| 633 | } |
| 634 | for _, f := range requiredCaps { |
| 635 | if _, ok := pCapMap[f]; !ok { |
| 636 | base.T.Skipf("test requires containerd plugin \"%s.%s\" with capabilities %v (missing %q)", requiredType, requiredID, requiredCaps, f) |
| 637 | } |
| 638 | } |
| 639 | return |
| 640 | } |
| 641 | if len(requiredCaps) == 0 { |
| 642 | base.T.Skipf("test requires containerd plugin \"%s.%s\"", requiredType, requiredID) |
| 643 | } else { |
| 644 | base.T.Skipf("test requires containerd plugin \"%s.%s\" with capabilities %v", requiredType, requiredID, requiredCaps) |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | func RequireSystemService(t testing.TB, sv string) { |
| 649 | t.Helper() |
nothing calls this directly
no test coverage detected
searching dependent graphs…