Committed by
Ray Milkey
According to the 802.1x standard, the state-machine should go back to connecting…
… state if a start packet is received while in authorized state Change-Id: I07ef81eb73d2422cbb85b9c8dd9fcd4f48742e2e
Showing
2 changed files
with
8 additions
and
4 deletions
... | @@ -83,7 +83,7 @@ class StateMachine { | ... | @@ -83,7 +83,7 @@ class StateMachine { |
83 | input | 83 | input |
84 | ---------------------------------------------------------------------------------------------------- | 84 | ---------------------------------------------------------------------------------------------------- |
85 | 85 | ||
86 | - START STARTED | _ | _ | _ | _ | 86 | + START STARTED | _ | _ | STARTED | _ |
87 | 87 | ||
88 | REQUEST_ACCESS _ | PENDING | _ | _ | _ | 88 | REQUEST_ACCESS _ | PENDING | _ | _ | _ |
89 | 89 | ||
... | @@ -101,7 +101,7 @@ class StateMachine { | ... | @@ -101,7 +101,7 @@ class StateMachine { |
101 | private int[] pendingTransition = | 101 | private int[] pendingTransition = |
102 | {STATE_PENDING, STATE_PENDING, STATE_AUTHORIZED, STATE_UNAUTHORIZED, STATE_PENDING}; | 102 | {STATE_PENDING, STATE_PENDING, STATE_AUTHORIZED, STATE_UNAUTHORIZED, STATE_PENDING}; |
103 | private int[] authorizedTransition = | 103 | private int[] authorizedTransition = |
104 | - {STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_IDLE}; | 104 | + {STATE_STARTED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_IDLE}; |
105 | private int[] unauthorizedTransition = | 105 | private int[] unauthorizedTransition = |
106 | {STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_IDLE}; | 106 | {STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_IDLE}; |
107 | 107 | ||
... | @@ -515,6 +515,10 @@ class StateMachine { | ... | @@ -515,6 +515,10 @@ class StateMachine { |
515 | private final Logger log = getLogger(getClass()); | 515 | private final Logger log = getLogger(getClass()); |
516 | private String name = "AUTHORIZED_STATE"; | 516 | private String name = "AUTHORIZED_STATE"; |
517 | 517 | ||
518 | + public void start() { | ||
519 | + log.info("Moving from AUTHORIZED state to STARTED state."); | ||
520 | + } | ||
521 | + | ||
518 | public void logoff() { | 522 | public void logoff() { |
519 | 523 | ||
520 | log.info("Moving from AUTHORIZED state to IDLE state."); | 524 | log.info("Moving from AUTHORIZED state to IDLE state."); | ... | ... |
... | @@ -175,10 +175,10 @@ public class StateMachineTest { | ... | @@ -175,10 +175,10 @@ public class StateMachineTest { |
175 | stateMachine.authorizeAccess(); | 175 | stateMachine.authorizeAccess(); |
176 | 176 | ||
177 | stateMachine.start(); | 177 | stateMachine.start(); |
178 | - Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED); | 178 | + Assert.assertEquals(stateMachine.state(), StateMachine.STATE_STARTED); |
179 | 179 | ||
180 | stateMachine.requestAccess(); | 180 | stateMachine.requestAccess(); |
181 | - Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED); | 181 | + Assert.assertEquals(stateMachine.state(), StateMachine.STATE_PENDING); |
182 | 182 | ||
183 | stateMachine.authorizeAccess(); | 183 | stateMachine.authorizeAccess(); |
184 | Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED); | 184 | Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED); | ... | ... |
-
Please register or login to post a comment