| @@ 117-138 (lines=22) @@ | ||
| 114 | ); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function testConnectNotInAcl() |
|
| 118 | { |
|
| 119 | $this->assertSame( |
|
| 120 | [ |
|
| 121 | 'ok' => false, |
|
| 122 | 'error' => 'user not in ACL', |
|
| 123 | ], |
|
| 124 | $this->makeRequest( |
|
| 125 | ['vpn-server-node', 'aabbcc'], |
|
| 126 | 'POST', |
|
| 127 | 'connect', |
|
| 128 | [], |
|
| 129 | [ |
|
| 130 | 'profile_id' => 'acl2', |
|
| 131 | 'common_name' => '12345678901234567890123456789012', |
|
| 132 | 'ip4' => '10.10.10.10', |
|
| 133 | 'ip6' => 'fd00:4242:4242:4242::', |
|
| 134 | 'connected_at' => 12345678, |
|
| 135 | ] |
|
| 136 | ) |
|
| 137 | ); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testDisconnect() |
|
| 141 | { |
|
| @@ 140-159 (lines=20) @@ | ||
| 137 | ); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testDisconnect() |
|
| 141 | { |
|
| 142 | $this->assertTrue( |
|
| 143 | $this->makeRequest( |
|
| 144 | ['vpn-server-node', 'aabbcc'], |
|
| 145 | 'POST', |
|
| 146 | 'disconnect', |
|
| 147 | [], |
|
| 148 | [ |
|
| 149 | 'profile_id' => 'internet', |
|
| 150 | 'common_name' => '12345678901234567890123456789012', |
|
| 151 | 'ip4' => '10.10.10.10', |
|
| 152 | 'ip6' => 'fd00:4242:4242:4242::', |
|
| 153 | 'connected_at' => 12345678, |
|
| 154 | 'disconnected_at' => 23456789, |
|
| 155 | 'bytes_transferred' => 2222222, |
|
| 156 | ] |
|
| 157 | ) |
|
| 158 | ); |
|
| 159 | } |
|
| 160 | ||
| 161 | public function testVerifyOtp() |
|
| 162 | { |
|