changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/pod/tests.lisp

changeset 698: 96958d3eb5b0
parent: 7354623e5b54
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; lib/pod/tests.lisp --- Pod tests
2 
3 ;;
4 
5 ;;; Code:
6 (defpackage :pod/tests
7  (:use :cl :rt :pod :sb-bsd-sockets)
8  (:import-from :dat/proto :serde))
9 
10 (in-package :pod/tests)
11 
12 (defsuite :pod)
13 (in-suite :pod)
14 
15 (deftest podman-api ()
16  "Test the podman API over a local unix socket."
17  (unless (probe-file *podman-local-user-socket*)
18  (start-podman-service *podman-local-user-socket*))
19  (with-libpod-client (c)
20  (is (string= "OK" (libpod-request c "_ping" :get)))
21  (is (libpod-request-json c "info"))
22  ;; (is (libpod-request-json c "events")) ;; hangs
23  (is (libpod-request c "version"))
24  (is (libpod-request-json c "containers/json"))))
25 
26 (defvar *test-containerfile* "ARG FOO=bar
27 ARG BAR=foo
28 FROM ${FOO}/${BAR}
29 RUN sbcl
30 ")
31 
32 (deftest containerfile ()
33  "Roundtrip CONTAINERFILE tests."
34  (let ((cf (serde *test-containerfile* (make-instance 'containerfile))))
35  (is (= 2 (length (containerfile-args cf))))
36  (is (string= "${FOO}/${BAR}" (containerfile-base cf)))
37  (is (= 1 (length (containerfile-steps cf))))
38  (is (string= *test-containerfile* (dat/proto:serialize cf :string)))))