Lines Matching refs:be
35 my $be = $srv->accept();
36 $be->autoflush(1);
37 ok(defined $be, "mock backend created");
38 like(<$be>, qr/version/, "received version command");
39 print $be "VERSION 1.0.0-mock\r\n";
41 return $be;
65 my $be = accept_backend($msrv);
66 push(@mbe, $be);
84 my $be = $mbe[$idx];
85 is(scalar <$be>, $cmd, "sanity check: touch cmd received for be " . $idx);
86 print $be "TOUCHED\r\n";
112 my $be = $mbe[$idx];
114 is(scalar <$be>, $recv, "be " . $idx . " received expected response");
122 my $be = $mbe[$idx];
124 print $be $send;
201 my $be = $mbe[0];
210 is(scalar <$be>, "get /b/a\r\n", "get passthrough");
213 print $be "VALUE /b/a 0 2\r\nhi\r\nEN";
231 my $be = $mbe[0];
237 is(scalar <$be>, "get /b/c\r\n", "get passthrough");
239 print $be "VALUE /b/c 0 2\r\nok\r\nEND\r\ngarbage";
285 my $be = $mbe[0];
291 is(scalar <$be>, "get /b/c\r\n", "get passthrough");
296 print $be "VALUE /b/c 0 5\r\nhe";
298 print $be "llo";
300 print $be "\r\nEND\r\n";
312 my $be = $mbe[0];
315 is(scalar <$be>, "get /b/c\r\n", "get passthrough");
320 print $be "VALUE /b/c 0 5\r\nhe";
322 print $be "llo";
324 print $be "\r\nEND\r\n";
344 my $be = $mbe[0];
352 is(scalar <$be>, "$cmd\r\n", "set passthrough");
353 is(scalar <$be>, "hi\r\n", "set value");
354 print $be "STORED\r\n";
363 is(scalar <$be>, "$cmd\r\n", "set passthrough (large value)");
364 is(scalar <$be>, "$data\r\n", "set value (large value)");
365 print $be "STORED\r\n";
386 is(scalar <$be>, "$cmd\r\n", "set passthrough (repeated)");
387 is(scalar <$be>, "$data\r\n", "set value (repeated)");
390 print $be $repeated_resp_be;
399 is(scalar <$be>, $cmd, "get passthrough");
400 print $be "VALUE /b/a 0 2\r\nhi\r\nEND\r\n";
411 is(scalar <$be>, $cmd, "get passthrough (large value)");
412 print $be "VALUE /b/a 0 $datasize\r\n$data\r\nEND\r\n";
421 is(scalar <$be>, $cmd, "touch passthrough");
422 print $be "TOUCHED\r\n";
429 is(scalar <$be>, $cmd, "gets passthrough");
430 print $be "VALUE /b/a 0 2 2\r\nhi\r\nEND\r\n";
439 is(scalar <$be>, $cmd, "gat passthrough");
440 print $be "VALUE /b/a 0 2\r\nhi\r\nEND\r\n";
449 is(scalar <$be>, $cmd, "gat passthrough");
450 print $be "END\r\n";
457 is(scalar <$be>, $cmd, "gats passthrough");
458 print $be "VALUE /b/a 0 2 1\r\nhi\r\nEND\r\n";
467 is(scalar <$be>, "$cmd\r\n", "cas passthrough");
468 is(scalar <$be>, "hi\r\n", "cas value");
469 print $be "STORED\r\n";
476 is(scalar <$be>, "$cmd\r\n", "cas passthrough");
477 is(scalar <$be>, "abc\r\n", "cas value");
478 print $be "EXISTS\r\n";
485 is(scalar <$be>, "$cmd\r\n", "add passthrough");
486 is(scalar <$be>, "hi\r\n", "add value");
487 print $be "STORED\r\n";
494 is(scalar <$be>, "$cmd\r\n", "add passthrough");
495 is(scalar <$be>, "abcd\r\n", "add value");
496 print $be "NOT_STORED\r\n";
503 is(scalar <$be>, $cmd, "delete passthrough");
504 print $be "DELETED\r\n";
511 is(scalar <$be>, $cmd, "incr passthrough");
512 print $be "2\r\n";
519 is(scalar <$be>, $cmd, "decr passthrough");
520 print $be "10\r\n";
527 is(scalar <$be>, "$cmd\r\n", "append passthrough");
528 is(scalar <$be>, "hi\r\n", "append value");
529 print $be "STORED\r\n";
536 is(scalar <$be>, "$cmd\r\n", "prepend passthrough");
537 is(scalar <$be>, "hi\r\n", "prepend value");
538 print $be "STORED\r\n";
548 is(scalar <$be>, $cmd, "mg passthrough");
549 print $be "HD\r\n";
555 is(scalar <$be>, "$cmd\r\n", "ms passthrough");
556 is(scalar <$be>, "hi\r\n", "ms value");
557 print $be "HD\r\n";
564 is(scalar <$be>, $cmd, "md passthrough");
565 print $be "HD\r\n";
571 is(scalar <$be>, $cmd, "ma passthrough");
572 print $be "HD\r\n";
588 my $be = $mbe[0];
591 is(scalar <$be>, "get /b/a\r\n", "multiget breakdown a");
592 is(scalar <$be>, "get /b/b\r\n", "multiget breakdown b");
593 is(scalar <$be>, "get /b/c\r\n", "multiget breakdown c");
595 print $be "VALUE /b/a 0 1\r\na\r\n",
610 is(scalar <$be>, "get /b/a\r\n", "multiget breakdown a");
611 is(scalar <$be>, "get /b/b\r\n", "multiget breakdown b");
612 is(scalar <$be>, "get /b/c\r\n", "multiget breakdown c");
614 print $be "END\r\nEND\r\nEND\r\n";
619 is(scalar <$be>, "get /b/a\r\n", "get works after empty multiget");
620 print $be "END\r\n";
634 my $be = $mbe[0];
637 is(scalar <$be>, "set /b/a 0 0 2 noreplY\r\n", "set received with broken noreply");
638 is(scalar <$be>, "hi\r\n", "set payload received");
640 print $be "STORED\r\n";
645 is(scalar <$be>, $cmd, "canary touch received");
646 print $be "TOUCHED\r\n";
695 my $be = $mbe[0];
708 is(scalar <$be>, "get /rtrimkey/one \r\n", "request:rtrimkey()");
709 print $be "END\r\n";
714 is(scalar <$be>, "get test\r\n", "request:ltrimkey()");
715 print $be "END\r\n";
821 my $be = $mbe[0];
824 is(scalar <$be>, "mg /request/clone v\r\n", "get passthrough");
825 print $be "VA 1 v\r\n4\r\n";
839 my $be = $mbe[0];
842 is(scalar <$be>, $cmd, "be received request.");
844 print $be "HD\r\n";
1088 my $be = $tu->[1];
1091 is(scalar <$be>, $cmd, "routed proper zone: " . $tu->[0]);
1092 print $be "END\r\n";
1113 my $be = $mbe[0];
1127 is(scalar <$be>, $cmd, "got passthru for log");
1128 print $be "END\r\n";
1136 is(scalar <$be>, $cmd, "got passthru for logsamp");
1137 print $be "END\r\n";
1142 is(scalar <$be>, $cmd, "got passthru for logsamp");
1146 print $be "END\r\n";
1162 my $be = $mbe[0];
1164 is(scalar <$be>, "set /b/foo 0 0 2\r\n", "received set cmd");
1165 is(scalar <$be>, "hi\r\n", "received set data");
1168 print $be $msg;
1172 is(scalar <$be>, "get /b/foo\r\n", "backend still works");
1173 print $be "END\r\n";
1178 is(scalar <$be>, "get /b/moo\r\n", "received get command");
1181 print $be $msg;
1183 my $read = $be->read($data, 1);
1186 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1189 is(scalar <$be>, "get /b/too\r\n", "received get command");
1191 print $be $msg;
1193 $read = $be->read($data, 1);
1196 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1200 is(scalar <$be>, "get /b/zoo\r\n", "received get command");
1202 print $be $msg;
1204 $read = $be->read($data, 1);
1207 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1211 is(scalar <$be>, "get /b/doo\r\n", "received get command");
1212 print $be "garbage\r\n"; # don't need the \r\n but it makes tests easier
1215 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1219 is(scalar <$be>, "get /b/quu\r\n", "received get command");
1220 is(scalar <$be>, "get /b/muu\r\n", "received next get command");
1221 print $be "CLIENT_ERROR bad protocol\r\nEND\r\n";
1225 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1229 is(scalar <$be>, "get /errcheck/a\r\n", "received get command");
1230 print $be "ERROR test1\r\n";
1233 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1236 is(scalar <$be>, "get /errcheck/b\r\n", "received get command");
1237 print $be "CLIENT_ERROR test2\r\n";
1240 $be = $mbe[0] = accept_backend($mocksrvs[0]);
1243 is(scalar <$be>, "get /errcheck/c\r\n", "received get command");
1244 print $be "SERVER_ERROR test3\r\n";