mirror of
https://github.com/fleetdm/fleet
synced 2026-04-30 18:07:56 +00:00
Resolves #37220 Added a dummy implementation of the orbit_info table to the orbit shell. A full implementation is not possible directly in the shell because the orbit service stores specific instrumentation values in memory. To query the live orbit_info table, users must connect to the osquery-orbit extension socket.
23 lines
607 B
Go
23 lines
607 B
Go
package table
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/osquery/osquery-go/plugin/table"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestEmptyExtension(t *testing.T) {
|
|
msg := "install orbit for more info"
|
|
ext := EmptyExtension{name: "empty_table", msg: msg}
|
|
|
|
assert.Equal(t, "empty_table", ext.Name())
|
|
assert.Equal(t, []table.ColumnDefinition{table.TextColumn("message")}, ext.Columns())
|
|
|
|
rows, err := ext.GenerateFunc(context.Background(), table.QueryContext{})
|
|
require.NoError(t, err)
|
|
require.Len(t, rows, 1)
|
|
assert.Equal(t, msg, rows[0]["message"])
|
|
}
|