veyron2/services/mgmt/node,veyron/services/mgmt/node,veyron/tools/mgmt: rename node->device, cl 3 of N (go/vissue/496)
Rename files and packages.
Change-Id: I29199a97c2ca6d6eb721e0d9fe41a71044e52579
diff --git a/tools/mgmt/nodex/acl_fmt.go b/tools/mgmt/device/acl_fmt.go
similarity index 100%
rename from tools/mgmt/nodex/acl_fmt.go
rename to tools/mgmt/device/acl_fmt.go
diff --git a/tools/mgmt/nodex/acl_impl.go b/tools/mgmt/device/acl_impl.go
similarity index 83%
rename from tools/mgmt/nodex/acl_impl.go
rename to tools/mgmt/device/acl_impl.go
index f54c2ee..f3afeb5 100644
--- a/tools/mgmt/nodex/acl_impl.go
+++ b/tools/mgmt/device/acl_impl.go
@@ -7,7 +7,7 @@
"veyron.io/lib/cmdline"
"veyron.io/veyron/veyron2/security"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
"veyron.io/veyron/veyron2/services/security/access"
verror "veyron.io/veyron/veyron2/verror2"
)
@@ -17,9 +17,9 @@
Name: "get",
Short: "Get ACLs for the given target.",
Long: "Get ACLs for the given target.",
- ArgsName: "<node manager name>",
+ ArgsName: "<device manager name>",
ArgsLong: `
-<node manager name> can be a Vanadium name for a node manager,
+<device manager name> can be a Vanadium name for a device manager,
application installation or instance.`,
}
@@ -29,7 +29,7 @@
}
vanaName := args[0]
- objACL, _, err := node.ApplicationClient(vanaName).GetACL(runtime.NewContext())
+ objACL, _, err := device.ApplicationClient(vanaName).GetACL(runtime.NewContext())
if err != nil {
return fmt.Errorf("GetACL on %s failed: %v", vanaName, err)
}
@@ -52,9 +52,9 @@
Name: "set",
Short: "Set ACLs for the given target.",
Long: "Set ACLs for the given target",
- ArgsName: "<node manager name> (<blessing> [!]<tag>(,[!]<tag>)*",
+ ArgsName: "<device manager name> (<blessing> [!]<tag>(,[!]<tag>)*",
ArgsLong: `
-<node manager name> can be a Vanadium name for a node manager,
+<device manager name> can be a Vanadium name for a device manager,
application installation or instance.
<blessing> is a blessing pattern.
@@ -97,7 +97,7 @@
// Set the ACLs on the specified names.
ctx := runtime.NewContext()
for {
- objACL, etag, err := node.ApplicationClient(vanaName).GetACL(ctx)
+ objACL, etag, err := device.ApplicationClient(vanaName).GetACL(ctx)
if err != nil {
return cmd.UsageErrorf("GetACL(%s) failed: %v", vanaName, err)
}
@@ -111,7 +111,7 @@
}
}
}
- switch err := node.ApplicationClient(vanaName).SetACL(ctx, objACL, etag); {
+ switch err := device.ApplicationClient(vanaName).SetACL(ctx, objACL, etag); {
case err != nil && !verror.Is(err, access.ErrBadEtag):
return cmd.UsageErrorf("SetACL(%s) failed: %v", vanaName, err)
case err == nil:
@@ -125,9 +125,9 @@
func aclRoot() *cmdline.Command {
return &cmdline.Command{
Name: "acl",
- Short: "Tool for setting node manager ACLs",
+ Short: "Tool for setting device manager ACLs",
Long: `
-The acl tool manages ACLs on the node manger, installations and instances.
+The acl tool manages ACLs on the device manger, installations and instances.
`,
Children: []*cmdline.Command{cmdGet, cmdSet},
}
diff --git a/tools/mgmt/nodex/acl_test.go b/tools/mgmt/device/acl_test.go
similarity index 98%
rename from tools/mgmt/nodex/acl_test.go
rename to tools/mgmt/device/acl_test.go
index 9e6b945..ea054ff 100644
--- a/tools/mgmt/nodex/acl_test.go
+++ b/tools/mgmt/device/acl_test.go
@@ -13,7 +13,7 @@
verror "veyron.io/veyron/veyron2/verror2"
)
-const pkgPath = "veyron.io/veyron/veyron/tools/mgmt/nodex/main"
+const pkgPath = "veyron.io/veyron/veyron/tools/mgmt/device/main"
var (
errOops = verror.Register(pkgPath+".errOops", verror.NoRetry, "oops!")
diff --git a/tools/mgmt/nodex/associate_impl.go b/tools/mgmt/device/associate_impl.go
similarity index 90%
rename from tools/mgmt/nodex/associate_impl.go
rename to tools/mgmt/device/associate_impl.go
index 06d77c3..b9900fa 100644
--- a/tools/mgmt/nodex/associate_impl.go
+++ b/tools/mgmt/device/associate_impl.go
@@ -5,7 +5,7 @@
"time"
"veyron.io/lib/cmdline"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
)
var cmdList = &cmdline.Command{
@@ -25,7 +25,7 @@
ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
defer cancel()
- assocs, err := node.DeviceClient(args[0]).ListAssociations(ctx)
+ assocs, err := device.DeviceClient(args[0]).ListAssociations(ctx)
if err != nil {
return fmt.Errorf("ListAssociations failed: %v", err)
}
@@ -54,7 +54,7 @@
}
ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
defer cancel()
- return node.DeviceClient(args[0]).AssociateAccount(ctx, args[2:], args[1])
+ return device.DeviceClient(args[0]).AssociateAccount(ctx, args[2:], args[1])
}
var cmdRemove = &cmdline.Command{
@@ -74,7 +74,7 @@
}
ctx, cancel := runtime.NewContext().WithTimeout(time.Minute)
defer cancel()
- return node.DeviceClient(args[0]).AssociateAccount(ctx, args[1:], "")
+ return device.DeviceClient(args[0]).AssociateAccount(ctx, args[1:], "")
}
func associateRoot() *cmdline.Command {
diff --git a/tools/mgmt/nodex/nodemanager_mock_test.go b/tools/mgmt/device/devicemanager_mock_test.go
similarity index 93%
rename from tools/mgmt/nodex/nodemanager_mock_test.go
rename to tools/mgmt/device/devicemanager_mock_test.go
index 717122b..1ba7298 100644
--- a/tools/mgmt/nodex/nodemanager_mock_test.go
+++ b/tools/mgmt/device/devicemanager_mock_test.go
@@ -9,7 +9,7 @@
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/mgmt/binary"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
"veyron.io/veyron/veyron2/services/security/access"
"veyron.io/veyron/veyron2/vlog"
@@ -23,11 +23,11 @@
// Mock ListAssociations
type ListAssociationResponse struct {
- na []node.Association
+ na []device.Association
err error
}
-func (mni *mockDeviceInvoker) ListAssociations(ipc.ServerContext) (associations []node.Association, err error) {
+func (mni *mockDeviceInvoker) ListAssociations(ipc.ServerContext) (associations []device.Association, err error) {
vlog.VI(2).Infof("ListAssociations() was called")
ir := mni.tape.Record("ListAssociations")
@@ -64,8 +64,8 @@
return mni.simpleCore("Claim", "Claim")
}
-func (*mockDeviceInvoker) Describe(ipc.ServerContext) (node.Description, error) {
- return node.Description{}, nil
+func (*mockDeviceInvoker) Describe(ipc.ServerContext) (device.Description, error) {
+ return device.Description{}, nil
}
func (*mockDeviceInvoker) IsRunnable(_ ipc.ServerContext, description binary.Description) (bool, error) {
return false, nil
@@ -157,7 +157,7 @@
}
func (d *dispatcher) Lookup(suffix string) (interface{}, security.Authorizer, error) {
- return node.DeviceServer(&mockDeviceInvoker{tape: d.tape, t: d.t}), nil, nil
+ return device.DeviceServer(&mockDeviceInvoker{tape: d.tape, t: d.t}), nil, nil
}
func startServer(t *testing.T, r veyron2.Runtime, tape *Tape) (ipc.Server, naming.Endpoint, error) {
diff --git a/tools/mgmt/nodex/doc.go b/tools/mgmt/device/doc.go
similarity index 100%
rename from tools/mgmt/nodex/doc.go
rename to tools/mgmt/device/doc.go
diff --git a/tools/mgmt/nodex/impl.go b/tools/mgmt/device/impl.go
similarity index 86%
rename from tools/mgmt/nodex/impl.go
rename to tools/mgmt/device/impl.go
index 1bda19b..21f4119 100644
--- a/tools/mgmt/nodex/impl.go
+++ b/tools/mgmt/device/impl.go
@@ -7,7 +7,7 @@
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/security"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
)
var cmdInstall = &cmdline.Command{
@@ -26,7 +26,7 @@
return cmd.UsageErrorf("install: incorrect number of arguments, expected %d, got %d", expected, got)
}
deviceName, appName := args[0], args[1]
- appID, err := node.ApplicationClient(deviceName).Install(runtime.NewContext(), appName)
+ appID, err := device.ApplicationClient(deviceName).Install(runtime.NewContext(), appName)
if err != nil {
return fmt.Errorf("Install failed: %v", err)
}
@@ -63,7 +63,7 @@
return cmd.UsageErrorf("start: incorrect number of arguments, expected %d, got %d", expected, got)
}
appInstallation, grant := args[0], args[1]
- appInstanceIDs, err := node.ApplicationClient(appInstallation).Start(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant})
+ appInstanceIDs, err := device.ApplicationClient(appInstallation).Start(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant})
if err != nil {
return fmt.Errorf("Start failed: %v", err)
}
@@ -91,7 +91,7 @@
return cmd.UsageErrorf("claim: incorrect number of arguments, expected %d, got %d", expected, got)
}
deviceName, grant := args[0], args[1]
- if err := node.DeviceClient(deviceName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
+ if err := device.DeviceClient(deviceName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
return fmt.Errorf("Claim failed: %v", err)
}
fmt.Fprintln(cmd.Stdout(), "Successfully claimed.")
@@ -100,10 +100,10 @@
func root() *cmdline.Command {
return &cmdline.Command{
- Name: "nodex",
+ Name: "device",
Short: "Tool for interacting with the veyron device manager",
Long: `
-The nodex tool facilitates interaction with the veyron device manager.
+The device tool facilitates interaction with the veyron device manager.
`,
Children: []*cmdline.Command{cmdInstall, cmdStart, associateRoot(), cmdClaim, cmdStop, cmdSuspend, cmdResume, aclRoot()},
}
diff --git a/tools/mgmt/nodex/impl_test.go b/tools/mgmt/device/impl_test.go
similarity index 98%
rename from tools/mgmt/nodex/impl_test.go
rename to tools/mgmt/device/impl_test.go
index e7239d3..21128e1 100644
--- a/tools/mgmt/nodex/impl_test.go
+++ b/tools/mgmt/device/impl_test.go
@@ -9,7 +9,7 @@
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/rt"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
verror "veyron.io/veyron/veyron2/verror2"
)
@@ -36,7 +36,7 @@
// Test the 'list' command.
tape.SetResponses([]interface{}{ListAssociationResponse{
- na: []node.Association{
+ na: []device.Association{
{
"root/self",
"alice_self_account",
diff --git a/tools/mgmt/nodex/instance_impl.go b/tools/mgmt/device/instance_impl.go
similarity index 86%
rename from tools/mgmt/nodex/instance_impl.go
rename to tools/mgmt/device/instance_impl.go
index f419c22..ae50c85 100644
--- a/tools/mgmt/nodex/instance_impl.go
+++ b/tools/mgmt/device/instance_impl.go
@@ -6,7 +6,7 @@
"fmt"
"veyron.io/lib/cmdline"
- "veyron.io/veyron/veyron2/services/mgmt/node"
+ "veyron.io/veyron/veyron2/services/mgmt/device"
)
var cmdStop = &cmdline.Command{
@@ -25,7 +25,7 @@
}
appName := args[0]
- if err := node.ApplicationClient(appName).Stop(runtime.NewContext(), 5); err != nil {
+ if err := device.ApplicationClient(appName).Stop(runtime.NewContext(), 5); err != nil {
return fmt.Errorf("Stop failed: %v", err)
}
fmt.Fprintf(cmd.Stdout(), "Stop succeeded\n")
@@ -48,7 +48,7 @@
}
appName := args[0]
- if err := node.ApplicationClient(appName).Suspend(runtime.NewContext()); err != nil {
+ if err := device.ApplicationClient(appName).Suspend(runtime.NewContext()); err != nil {
return fmt.Errorf("Suspend failed: %v", err)
}
fmt.Fprintf(cmd.Stdout(), "Suspend succeeded\n")
@@ -71,7 +71,7 @@
}
appName := args[0]
- if err := node.ApplicationClient(appName).Resume(runtime.NewContext()); err != nil {
+ if err := device.ApplicationClient(appName).Resume(runtime.NewContext()); err != nil {
return fmt.Errorf("Resume failed: %v", err)
}
fmt.Fprintf(cmd.Stdout(), "Resume succeeded\n")
diff --git a/tools/mgmt/nodex/instance_impl_test.go b/tools/mgmt/device/instance_impl_test.go
similarity index 100%
rename from tools/mgmt/nodex/instance_impl_test.go
rename to tools/mgmt/device/instance_impl_test.go
diff --git a/tools/mgmt/nodex/main.go b/tools/mgmt/device/main.go
similarity index 100%
rename from tools/mgmt/nodex/main.go
rename to tools/mgmt/device/main.go
diff --git a/tools/mgmt/nodex/mock_test.go b/tools/mgmt/device/mock_test.go
similarity index 100%
rename from tools/mgmt/nodex/mock_test.go
rename to tools/mgmt/device/mock_test.go
diff --git a/tools/mgmt/nminstall b/tools/mgmt/nminstall
index c366dbf..bc47887 100755
--- a/tools/mgmt/nminstall
+++ b/tools/mgmt/nminstall
@@ -31,7 +31,7 @@
echo "./nminstall [--single_user] <install parent dir> [<binary source>] [-- args for device manager...]"
}
-readonly BIN_NAMES=(noded suidhelper agentd)
+readonly BIN_NAMES=(deviced suidhelper agentd)
###############################################################################
# Copies one binary from source to destination.
@@ -191,7 +191,7 @@
exit 1
fi
- VEYRON_NM_CURRENT="${INSTALL_DIR}/deviced.curr" VEYRON_NM_ROOT="${NM_ROOT}" VEYRON_NM_HELPER="${SETUID_SCRIPT}" "${BIN_INSTALL}/noded" --install_self -- --name="${PUBLISH}" "$@"
+ VEYRON_NM_CURRENT="${INSTALL_DIR}/deviced.curr" VEYRON_NM_ROOT="${NM_ROOT}" VEYRON_NM_HELPER="${SETUID_SCRIPT}" "${BIN_INSTALL}/deviced" --install_self -- --name="${PUBLISH}" "$@"
echo "Device manager installed."
local -r SECURITY_DIR="${INSTALL_DIR}/security"
diff --git a/tools/mgmt/test.sh b/tools/mgmt/test.sh
index 5cd276f..97d650c 100755
--- a/tools/mgmt/test.sh
+++ b/tools/mgmt/test.sh
@@ -13,8 +13,8 @@
APPLICATION_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/application')"
AGENTD_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/security/agent/agentd')"
SUIDHELPER_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/suidhelper')"
- DEVICEMANAGER_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/node/noded')"
- NODEX_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/mgmt/nodex')"
+ DEVICEMANAGER_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/device/deviced')"
+ DEVICE_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/mgmt/device')"
NAMESPACE_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/namespace')"
PRINCIPAL_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/principal')"
DEBUG_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/debug')"
@@ -80,7 +80,7 @@
export VEYRON_CREDENTIALS=./alice
# Claim the device as "alice/myworkstation".
- "${NODEX_BIN}" claim "${NM_NAME}/nm" myworkstation
+ "${DEVICE_BIN}" claim "${NM_NAME}/nm" myworkstation
# Verify the device's default blessing is as expected.
shell_test::assert_eq "$("${DEBUG_BIN}" stats read "${NM_NAME}/__debug/stats/security/principal/blessingstore" | head -1 | sed -e 's/^.*Default blessings: '//)" \
@@ -118,14 +118,14 @@
"BINARYD" "${LINENO}"
# Install the app on the device.
- local -r INSTALLATION_NAME=$("${NODEX_BIN}" install "${NM_NAME}/apps" "${SAMPLE_APP_NAME}" | sed -e 's/Successfully installed: "//' | sed -e 's/"//')
+ local -r INSTALLATION_NAME=$("${DEVICE_BIN}" install "${NM_NAME}/apps" "${SAMPLE_APP_NAME}" | sed -e 's/Successfully installed: "//' | sed -e 's/"//')
# Verify that the installation shows up when globbing the device manager.
shell_test::assert_eq "$("${NAMESPACE_BIN}" glob "${NM_NAME}/apps/BINARYD/*")" \
"${INSTALLATION_NAME}" "${LINENO}"
# Start an instance of the app, granting it blessing extension myapp.
- local -r INSTANCE_NAME=$("${NODEX_BIN}" start "${INSTALLATION_NAME}" myapp | sed -e 's/Successfully started: "//' | sed -e 's/"//')
+ local -r INSTANCE_NAME=$("${DEVICE_BIN}" start "${INSTALLATION_NAME}" myapp | sed -e 's/Successfully started: "//' | sed -e 's/"//')
wait_for_mountentry "${NAMESPACE_BIN}" "5" "${APP_PUBLISH_NAME}"
# Verify that the instance shows up when globbing the device manager.
@@ -136,7 +136,7 @@
"alice/myapp/BINARYD" "${LINENO}"
# Stop the instance.
- "${NODEX_BIN}" stop "${INSTANCE_NAME}"
+ "${DEVICE_BIN}" stop "${INSTANCE_NAME}"
# Verify that logs, but not stats, show up when globbing the stopped instance.
shell_test::assert_eq "$("${NAMESPACE_BIN}" glob "${INSTANCE_NAME}/stats/...")" "" "${LINENO}"
diff --git a/tools/vrpc/impl.go b/tools/vrpc/impl.go
index d057082..868a0fe 100644
--- a/tools/vrpc/impl.go
+++ b/tools/vrpc/impl.go
@@ -17,7 +17,7 @@
"veyron.io/veyron/veyron2/wiretype"
idl_binary "veyron.io/veyron/veyron2/services/mgmt/binary"
- idl_node "veyron.io/veyron/veyron2/services/mgmt/node"
+ idl_device "veyron.io/veyron/veyron2/services/mgmt/device"
)
const serverDesc = `
@@ -121,7 +121,7 @@
// empty interface, this will no longer be needed.
var x1 idl_test_base.Struct
vdlutil.Register(x1)
- var x2 idl_node.Description
+ var x2 idl_device.Description
vdlutil.Register(x2)
var x3 idl_binary.Description
vdlutil.Register(x3)