github.com/vmware/govmomi@v0.51.0/vim25/types/unreleased_test.go (about)

     1  // © Broadcom. All Rights Reserved.
     2  // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
     3  // SPDX-License-Identifier: Apache-2.0
     4  
     5  package types_test
     6  
     7  import (
     8  	"context"
     9  	"testing"
    10  
    11  	"github.com/vmware/govmomi/property"
    12  	"github.com/vmware/govmomi/simulator"
    13  	"github.com/vmware/govmomi/vim25"
    14  	"github.com/vmware/govmomi/vim25/mo"
    15  	"github.com/vmware/govmomi/vim25/types"
    16  )
    17  
    18  func TestPodVMOverheadInfo(t *testing.T) {
    19  	simulator.Test(func(ctx context.Context, c *vim25.Client) {
    20  		host := simulator.Map(ctx).Any("HostSystem").(*simulator.HostSystem)
    21  
    22  		host.Capability.PodVMOverheadInfo = &types.PodVMOverheadInfo{
    23  			CrxPageSharingSupported:         true,
    24  			PodVMOverheadWithoutPageSharing: int32(42),
    25  			PodVMOverheadWithPageSharing:    int32(53),
    26  		}
    27  
    28  		var props mo.HostSystem
    29  		pc := property.DefaultCollector(c)
    30  		err := pc.RetrieveOne(ctx, host.Self, []string{"capability"}, &props)
    31  		if err != nil {
    32  			t.Fatal(err)
    33  		}
    34  
    35  		if *props.Capability.PodVMOverheadInfo != *host.Capability.PodVMOverheadInfo {
    36  			t.Errorf("%#v", props.Capability.PodVMOverheadInfo)
    37  		}
    38  	})
    39  }