# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

setup:
- command: [docker, network, create, -d, bridge, testbridge]
- command: [docker, run, --net, testbridge, --name, some-memcached, -d, '$IMAGE']
- command: [docker, run, --net, testbridge, --name, external-container, -dt, debian]
- command: [sleep, 30s]
- command: [docker, exec, external-container, apt, update]
- command: [docker, exec, external-container, apt, install, netcat, -y]

teardown:
- command: [docker, rm, -f, some-memcached]
- command: [docker, rm, -f, external-container]

target: external-container
tests:
- name: Can write and read variable
  command:
    - bash
    - '-c'
    - 
      ' printf
      "set bar 0 60 9\r\nsome text\r\nget bar\r\nquit\r\n"
      | netcat -q 1 some-memcached 11211 '
  expect:
    stdout:
      equals: "STORED\r\nVALUE bar 0 9\r\nsome text\r\nEND"

Add test to set and read string
Add test to set and read string

Change-Id: I20545892645bc736503c372e8ad133fd701dfc84
