mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
terraform: remove cloud loggers (#2892)
* terraform: remove cloud logging apps * internal/cloud: remove loggers * bootstrapper: remove logging * qemu-metadata-api: remove logging endpoint * docs: add instructions on how to get boot logs * bazel: tidy * docs: fix typo * cloud: remove unused types * Update go.mod Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com> * bazel: tidy * Update docs/docs/workflows/troubleshooting.md Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com> * Update docs/docs/workflows/troubleshooting.md Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com> * Update docs/docs/workflows/troubleshooting.md Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com> * docs: elaborate on how to get boot logs * bazel: tidy --------- Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com> Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>
This commit is contained in:
parent
dde3430da8
commit
901edd420b
25 changed files with 12 additions and 1456 deletions
|
@ -13,7 +13,6 @@ import (
|
|||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/hack/qemu-metadata-api/virtwrapper"
|
||||
|
@ -223,55 +222,6 @@ func TestListPeers(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestPostLog(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
remoteAddr string
|
||||
message io.Reader
|
||||
method string
|
||||
wantErr bool
|
||||
}{
|
||||
"success": {
|
||||
remoteAddr: "192.0.100.1:1234",
|
||||
method: http.MethodPost,
|
||||
message: strings.NewReader("test message"),
|
||||
},
|
||||
"no body": {
|
||||
remoteAddr: "192.0.100.1:1234",
|
||||
method: http.MethodPost,
|
||||
message: nil,
|
||||
wantErr: true,
|
||||
},
|
||||
"incorrect method": {
|
||||
remoteAddr: "192.0.100.1:1234",
|
||||
method: http.MethodGet,
|
||||
message: strings.NewReader("test message"),
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
require := require.New(t)
|
||||
|
||||
server := New(logger.NewTest(t), "test", "initSecretHash", &stubConnect{})
|
||||
|
||||
req, err := http.NewRequestWithContext(context.Background(), tc.method, "http://192.0.0.1/logs", tc.message)
|
||||
require.NoError(err)
|
||||
req.RemoteAddr = tc.remoteAddr
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
server.postLog(w, req)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.NotEqual(http.StatusOK, w.Code)
|
||||
} else {
|
||||
assert.Equal(http.StatusOK, w.Code)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestInitSecretHash(t *testing.T) {
|
||||
defaultConnect := &stubConnect{
|
||||
network: newStubNetwork([]virtwrapper.NetworkDHCPLease{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue