aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu tests audio)
  #:use-module (gnu tests)
  #:use-module (gnu system)
  #:use-module (gnu system vm)
  #:use-module (gnu services)
  #:use-module (gnu services audio)
  #:use-module (gnu services networking)
  #:use-module (gnu packages mpd)
  #:use-module (guix gexp)
  #:export (%test-mpd
            %test-mympd))

(define %mpd-os
  (simple-operating-system
   (service mpd-service-type)))

(define (run-mpd-test)
  "Run tests in %mpd-os, which has mpd running."
  (define os
    (marionette-operating-system
     %mpd-os
     #:imported-modules '((gnu services herd))))

  (define vm
    (virtual-machine os))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (srfi srfi-64)
                       (gnu build marionette))
          (define marionette
            (make-marionette (list #$vm)))

          (test-runner-current (system-test-runner #$output))
          (test-begin "mpd")

          (test-assert "service is running"
            (marionette-eval
             '(begin
                (use-modules (gnu services herd))
                (start-service 'mpd))
             marionette))

          (test-assert "mpd listening"
            ;; Wait until mpd is actually listening before spawning 'mpc'.
            (wait-for-tcp-port 6600 marionette))

          (test-equal "mpc connect"
            0
            (marionette-eval
             '(system* #$(file-append mpd-mpc "/bin/mpc"))
             marionette))

          (test-end))))
  (gexp->derivation "mpd-test" test))

(define %test-mpd
  (system-test
   (name "mpd")
   (description "Test that the mpd can run and be connected to.")
   (value (run-mpd-test))))

(define (run-mympd-test)
  (define os (marionette-operating-system
              (simple-operating-system (service dhcp-client-service-type)
                                       (service mympd-service-type))
              #:imported-modules '((gnu services herd))))

  (define vm
    (virtual-machine
     (operating-system os)
     (port-forwardings '((8080 . 80)))))

  (define test
    (with-imported-modules '((gnu build marionette))
      #~(begin
          (use-modules (srfi srfi-64)
                       (srfi srfi-8)
                       (web client)
                       (web response)
                       (gnu build marionette))

          (define marionette
            (make-marionette (list #$vm)))

          (test-runner-current (system-test-runner #$output))
          (test-begin "mympd")
          (test-assert "service is running"
            (marionette-eval '(begin
                                (use-modules (gnu services herd))

                                (start-service 'mympd))
                             marionette))

          (test-assert "HTTP port ready"
            (wait-for-tcp-port 80 marionette))

          (test-equal "http-head"
            200
            (receive (x _) (http-head "http://localhost:8080") (response-code x)))

          (test-end))))
  (gexp->derivation "mympd-test" test))

(define %test-mympd
  (system-test
   (name "mympd")
   (description "Connect to a running myMPD service.")
   (value (run-mympd-test))))
ckages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-05-26gnu: libical: Update to 3.0.8....* gnu/packages/calendar.scm (libical): Update to 3.0.8. [source](patches): Remove. Marius Bakke 2020-04-19Merge branch 'master' into core-updatesMarius Bakke 2020-04-18gnu: libical: Enable introspection and Vala bindings....* gnu/packages/calendar.scm (libical)[arguments]: Enable introspection and Vala bindings. [native-inputs]: Add gobject-introspection and vala. (cherry picked from commit 1538791f2003620ff3436cba316a594931a5ab72) Kei Kebreau 2020-04-17gnu: khal: Move propagated inputs to inputs....As a package one would install we can rely on wrapping the package and not propagating inputs to make it work correctly. * gnu/packages/calendar.scm (khal)[propagated-inputs]: Move all python packages... [inputs]: ... to here. Efraim Flashner 2020-04-17gnu: khal: Fix build with python-urwid-2.1.0....* gnu/packages/calendar.scm (khal)[source]: Download upstream patch to fix compatibility with newer python-urwid. Efraim Flashner 2020-03-19gnu: Add date....* gnu/packages/wm.scm (date): New variable. * gnu/packages/patches/date-output-pkg-config-files.patch: New file. * gnu/local.mk: Add patch. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brendan Tildesley 2020-02-03gnu: libical: Add upstream patch to preserve API compatibility....* gnu/packages/calendar.scm (libical)[source](patches): New field. Marius Bakke 2020-01-19gnu: libical: Update to 3.0.7....* gnu/packages/calendar.scm (libical): Update to 3.0.7. Marius Bakke 2019-12-12gnu: remind: Update to 3.1.17....* gnu/packages/calendar.scm (remind): Update to 3.1.17. Tobias Geerinckx-Rice 2019-10-08gnu: libical: Update to 3.0.6....* gnu/packages/calendar.scm (libical): Update to 3.0.6. Marius Bakke 2019-05-24gnu: libical: Update to 3.0.5....* gnu/packages/calendar.scm (libical): Update to 3.0.5. [native-inputs]: Add GTK-DOC. Marius Bakke 2019-05-24gnu: Move Sphinx and friends to (gnu packages sphinx)....* gnu/packages/python-xyz.scm (python-sphinxcontrib-websupport, python2-sphinxcontrib-websupport, python-sphinx, python2-sphinx, python-sphinx-gallery, python2-sphinx-gallery, python-sphinx-rtd-theme, python2-sphinx-rtd-theme, python-guzzle-sphinx-theme, python2-guzzle-sphinx-theme, python-sphinxcontrib-newsfeed, python-sphinxcontrib-programoutput, python2-sphinxcontrib-programoutput, python-sphinx-repoze-interface, python2-sphinx-repoze-interface, python-sphinx-cloud-sptheme, python2-sphinx-cloud-sptheme, python-sphinx-alabaster-theme, python2-sphinx-alabaster-theme, python-sphinx-me, python-sphinxcontrib-svg2pdfconverter): Move to ... (gnu): * gnu/packages/sphinx.scm: ... here. New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/packages/admin.scm, gnu/packages/bioinformatics.scm, gnu/packages/calendar.scm, gnu/packages/cluster.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/elf.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emulators.scm, gnu/packages/finance.scm, gnu/packages/image.scm, gnu/packages/libffi.scm, gnu/packages/mail.scm, gnu/packages/mpd.scm, gnu/packages/openstack.scm, gnu/packages/pdf.scm, gnu/packages/python-web.scm, gnu/packages/search.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/tls.scm, gnu/packages/web.scm: Adjust module imports. Marius Bakke