Implements a new Packer builder (oracle-bmcs) which adds support for building custom images for Oracle Bare Metal Cloud Services (BMCS) https://cloud.oracle.com/en_US/bare-metal. Additionally includes documentation for the oracle-bmcs builder.
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
// Copyright (c) 2017 Oracle America, Inc.
|
|
// The contents of this file are subject to the Mozilla Public License Version
|
|
// 2.0 (the "License"); you may not use this file except in compliance with the
|
|
// License. If a copy of the MPL was not distributed with this file, You can
|
|
// obtain one at http://mozilla.org/MPL/2.0/
|
|
|
|
package bmcs
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestListVNICAttachments(t *testing.T) {
|
|
setup()
|
|
defer teardown()
|
|
|
|
id := "ocid1.image.oc1.phx.a"
|
|
mux.HandleFunc("/vnicAttachments/", func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(w, `[{"id":"%s"}]`, id)
|
|
})
|
|
|
|
params := &ListVnicAttachmentsParams{InstanceID: id}
|
|
|
|
vnicAttachment, err := client.Compute.VNICAttachments.List(params)
|
|
if err != nil {
|
|
t.Errorf("Client.Compute.VNICAttachments.List() returned error: %v", err)
|
|
}
|
|
|
|
want := []VNICAttachment{{ID: id}}
|
|
|
|
if !reflect.DeepEqual(vnicAttachment, want) {
|
|
t.Errorf("Client.Compute.VNICAttachments.List() returned %+v, want %+v", vnicAttachment, want)
|
|
}
|
|
}
|