Files
virtual-kubelet/vendor/github.com/vmware/vic/tests/test-cases/Group1-Docker-Commands/1-08-Docker-Logs.md
Loc Nguyen 513cebe7b7 VMware vSphere Integrated Containers provider (#206)
* Add Virtual Kubelet provider for VIC

Initial virtual kubelet provider for VMware VIC.  This provider currently
handles creating and starting of a pod VM via the VIC portlayer and persona
server.  Image store handling via the VIC persona server.  This provider
currently requires the feature/wolfpack branch of VIC.

* Added pod stop and delete.  Also added node capacity.

Added the ability to stop and delete pod VMs via VIC.  Also retrieve
node capacity information from the VCH.

* Cleanup and readme file

Some file clean up and added a Readme.md markdown file for the VIC
provider.

* Cleaned up errors, added function comments, moved operation code

1. Cleaned up error handling.  Set standard for creating errors.
2. Added method prototype comments for all interface functions.
3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder.

* Add mocking code and unit tests for podcache, podcreator, and podstarter

Used the unit test framework used in VIC to handle assertions in the provider's
unit test.  Mocking code generated using OSS project mockery, which is compatible
with the testify assertion framework.

* Vendored packages for the VIC provider

Requires feature/wolfpack branch of VIC and a few specific commit sha of
projects used within VIC.

* Implementation of POD Stopper and Deleter unit tests (#4)

* Updated files for initial PR
2018-06-04 15:41:32 -07:00

3.8 KiB

Test 1-08 - Docker Logs

Purpose:

To verify that docker logs command is supported by VIC appliance

References:

1 - Docker Command Line Reference

Environment:

This test requires that a vSphere server is running and available

Test Steps:

  1. Deploy VIC build 7315 to appliance to vSphere server
  2. Issue docker run -d busybox sh -c "echo These pretzels are making me thirsty"
  3. Issue docker logs
  4. Issue docker logs --timestamps
  5. Upgrade the VCH to current build
  6. Issue docker run -d busybox sh -c "echo Whats the deeeal with Ovaltine"
  7. Issue docker logs --timestamps
  8. Issue docker logs --timestamps
  9. Issue docker create busybox /bin/sh -c 'seq 1 5000' to the VIC appliance
  10. Issue docker start to the VIC appliance
  11. Issue docker logs to the VIC appliance
  12. Issue docker logs --tail=all to the VIC appliance
  13. Issue docker logs --tail=200 to the VIC appliance
  14. Issue docker logs --tail=0 to the VIC appliance
  15. Issue docker create -t busybox /bin/sh -c 'for i in $(seq 1 5) ; do sleep 1 && echo line $i; done'
  16. Issue docker start to the VIC appliance
  17. Issue docker logs --follow to the VIC appliance
  18. Issue docker create busybox /bin/sh -c 'trap "seq 11 20; exit" HUP; seq 1 10; while true; do sleep 1; done'
  19. Issue docker start to the VIC appliance
  20. Issue docker logs to the VIC appliance, waiting for the first 10 lines
  21. Issue docker kill -s HUP to the VIC appliance, generating the next 10 lines
  22. Issue docker logs --tail=5 --follow to the VIC appliance
  23. Issue docker pull ubuntu
  24. Issue docker run ubuntu /bin/cat /bin/hostname >/tmp/hostname
  25. Issue docker logs >/tmp/hostname-logs
  26. Issue sha256sum on /tmp/hostname and /tmp/hostname-logs
  27. Issue docker run ubuntu /bin/ls >/tmp/ls
  28. Issue docker logs >/tmp/ls-logs
  29. Issue sha256sum on /tmp/ls and /tmp/ls-logs
  30. Issue docker logs --since=1s to the VIC appliance
  31. Issue docker logs --timestamps to the VIC appliance
  32. Issue docker logs
  33. Issue docker logs fakeContainer

Expected Outcome:

  • Steps 1-3,5-7,9-29 should all complete without error
  • Step 3 should output "These pretzels are making me thirsty"
  • Step 4 should output "vSphere Integrated Containers does not yet support '--timestamps'"
  • Step 7 should output "Whats the deeeal with Ovaltine?" with a timestamps
  • Step 8 should output "container does not support '--timestamp'"
  • Step 13 should output 200 lines
  • Step 14 should output 0 lines
  • Step 17 should have last line be
line 5
  • Step 20 should output 10 lines
  • Step 22 should output 15 lines
  • Steps 26 and 29 should produce matching sha256 hashes for both files
  • Step 30 should output 3 lines
  • Step 31 should result in an error with the following message:
Error: vSphere Integrated Containers does not yet support timestamped logs.
  • Step 32 should output all lines
  • Step 33 should result in an error with the following message:
Error: No such container: fakeContainer

Possible Problems:

  • This suite may fail when run locally due to a vic-machine upgrade issue. Since vic-machine checks the build number of its binary to determine upgrade status and a locally-built vic-machine binary may not have the BUILD_NUMBER set correctly, vic-machine upgrade may fail with the message foo-VCH has same or newer version x than installer version y. No upgrade is available. To resolve this, follow these steps:
    • Set BUILD_NUMBER to a high number at the top of the Makefile - BUILD_NUMBER ?= 9999999999
    • Re-build binaries - sudo make distclean && sudo make clean && sudo make all