mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
chore(connection): remove connecting state
This commit is contained in:
@@ -179,7 +179,7 @@ Modbus Test Setup
|
||||
|
||||
${state}= Get Node State ${modbus_node}
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_RUNNING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
Modbus Test Teardown
|
||||
Del Node ${modbus_node}
|
||||
|
||||
@@ -37,7 +37,7 @@ Start the configured node, it should return success
|
||||
Node Setting modbus-node ${MODBUS_TCP_CONFIG}
|
||||
${state} = Get Node State modbus-node
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_READY}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
${res} = Node Ctl modbus-node ${NODE_CTL_START}
|
||||
Check Response Status ${res} 200
|
||||
@@ -45,7 +45,7 @@ Start the configured node, it should return success
|
||||
|
||||
#${state} = Get Node State modbus-node
|
||||
#Should Be Equal As Integers ${state}[running] ${NODE_STATE_RUNNING}
|
||||
#Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
#Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
${res} = Node Ctl modbus-node ${NODE_CTL_STOP}
|
||||
Check Response Status ${res} 200
|
||||
@@ -53,7 +53,7 @@ Start the configured node, it should return success
|
||||
|
||||
${state} = Get Node State modbus-node
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_STOP}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
Stop node that is stopped, it should return failure
|
||||
${res} = Node Ctl modbus-node ${NODE_CTL_STOP}
|
||||
@@ -67,7 +67,7 @@ Start the stopped node, it should return success
|
||||
|
||||
${state} = Get Node State modbus-node
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_RUNNING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
Start the running node, it should return failure
|
||||
${res} = Node Ctl modbus-node ${NODE_CTL_START}
|
||||
@@ -79,7 +79,7 @@ When setting up a READY/RUNNING/STOPED node, the node status will not change
|
||||
|
||||
${state} = Get Node State modbus-node
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_RUNNING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
${res} = Node Ctl modbus-node ${NODE_CTL_STOP}
|
||||
Check Response Status ${res} 200
|
||||
@@ -89,6 +89,6 @@ When setting up a READY/RUNNING/STOPED node, the node status will not change
|
||||
|
||||
${state} = Get Node State modbus-node
|
||||
Should Be Equal As Integers ${state}[running] ${NODE_STATE_STOP}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_CONNECTING}
|
||||
Should Be Equal As Integers ${state}[link] ${NODE_LINK_STATE_DISCONNECTED}
|
||||
|
||||
[Teardown] Del Node modbus-node
|
||||
@@ -17,8 +17,7 @@ ${NODE_STATE_RUNNING} 3
|
||||
${NODE_STATE_STOP} 4
|
||||
|
||||
${NODE_LINK_STATE_DISCONNECTED} 0
|
||||
${NODE_LINK_STATE_CONNECTING} 1
|
||||
${NODE_LINK_STATE_CONNECTED} 2
|
||||
${NODE_LINK_STATE_CONNECTED} 1
|
||||
|
||||
${NODE_CTL_START} 0
|
||||
${NODE_CTL_STOP} 1
|
||||
|
||||
@@ -47,8 +47,7 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
NEU_NODE_LINK_STATE_DISCONNECTED = 0,
|
||||
NEU_NODE_LINK_STATE_CONNECTING = 1,
|
||||
NEU_NODE_LINK_STATE_CONNECTED = 2,
|
||||
NEU_NODE_LINK_STATE_CONNECTED = 1,
|
||||
} neu_node_link_state_e;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -147,7 +147,7 @@ static int driver_config(neu_plugin_t *plugin, const char *config)
|
||||
plog_info(plugin, "config: host: %s, port: %" PRId64 ", timeout: %" PRId64,
|
||||
host.v.val_str, port.v.val_int, timeout.v.val_int);
|
||||
|
||||
plugin->common.link_state = NEU_NODE_LINK_STATE_CONNECTING;
|
||||
plugin->common.link_state = NEU_NODE_LINK_STATE_DISCONNECTED;
|
||||
if (plugin->conn != NULL) {
|
||||
plugin->conn = neu_conn_reconfig(plugin->conn, ¶m);
|
||||
} else {
|
||||
|
||||
@@ -415,7 +415,7 @@ static int plguin_start_running(neu_plugin_t *plugin)
|
||||
|
||||
plugin->routine = routine;
|
||||
plugin->running = true;
|
||||
plugin->common.link_state = NEU_NODE_LINK_STATE_CONNECTING;
|
||||
plugin->common.link_state = NEU_NODE_LINK_STATE_DISCONNECTED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user