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))))
Prafulla Giri 2020-01-26guix-install.sh: Export INFOPATH to contain updated guix info-pages...* etc/guix-install.sh (sys_create_init_profile): Export INFOPATH to include the updated info-pages from ~/.config/guix/current/share/info. This also makes sure that both /usr/bin/info and $GUIX_PROFILE/bin/info can read guix info pages without throwing "no menu item 'guix' in node dir(Top)" error. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Prafulla Giri 2020-01-24news: Add ‘nl’ translation....* * etc/news.scm: Add ‘nl’ translation. Tobias Geerinckx-Rice 2020-01-24news: Add 'de' translation....* etc/news.scm: Add 'de' translation. Florian Pelz 2020-01-23news: Add entry for Guile 3.0....* etc/news.scm: Add entry for Guile 3.0. Ludovic Courtès 2020-01-17guix-install.sh: Create an init profile during installation...Create an init profile (/etc/profile.d/guix.sh) during installation for better integration with foreign distros. This file, read by login-shells sets a few environment variables (PATH, GUIX_PROFILE, GUIX_LOCALE, along with XDG_DATA_DIRS) and makes guix-installed packages readily available for the users. Other environment variables, as listed by `guix package --search-paths=prefix`, are also exported. Checks are in place to prevent the init profile from needlessly polluting the user's environment. * etc/guix-install.sh (sys_create_init_profile): New function to create /etc/profile.d/guix.sh init profile. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Prafulla Giri 2019-12-12news: Add 'de' translation....* etc/news.scm: Add 'de' translation. Florian Pelz 2019-12-12news: Add entry for "guix challenge --diff"....* etc/news.scm: Add entry for "guix challenge --diff". Ludovic Courtès 2019-12-04guix-install.sh: Use a deterministic umask....Users with strict umasks (e.g. 0077) would end up with an unreadable /gnu (mode 0700) and no way to run guix. Reported by A. <@aaap:matrix.org> on #guix. * etc/guix-install.sh (main): Set umask before installing anything. Tobias Geerinckx-Rice 2019-11-26guix build, daemon: Rename "--no-build-hook" to "--no-offload"....This is a followup to bc69ea2d605810cc32e13ed03d5848b8dc358b61. * guix/scripts/build.scm (show-build-options-help): Rename "--no-build-hook" to "--no-offload". (%standard-build-options): Likewise, and warn when "--no-build-hook" is passed. * nix/nix-daemon/guix-daemon.cc (options): Add "--no-offload" and mark "--no-build-hook" as hidden. * guix/scripts/offload.scm: Adjust comment. * doc/guix.texi (Invoking guix-daemon, Common Build Options): Replace "--no-build-hook" with "--no-offload". * etc/completion/fish/guix.fish, etc/completion/zsh/_guix: Adjust accordingly. Ludovic Courtès 2019-11-16news: Fix another 'de' translation typo....* etc/news.scm: Fix typo. Florian Pelz 2019-11-16news: Fix 'de' translation typo....* etc/news.scm: Fix typo. Florian Pelz 2019-11-15news: Add entry for "guix time-machine"....* etc/news.scm: Add entry for 'guix time-machine'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Konrad Hinsen 2019-11-09news: Add Spanish translation....* etc/news.scm: Add spanish translation. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Miguel Ángel Arruga Vivas 2019-11-08news: Add 'de' translation....* etc/news.scm: Add new 'de' translation. Florian Pelz 2019-11-07news: Add entry for package transformation options in "guix graph"....* etc/news.scm: Add entry for "guix graph --with-input". Ludovic Courtès 2019-11-02news: Add 'de' translation....* etc/news.scm: Add 'de' translation. Florian Pelz 2019-10-28news: Fix typo....Reported by Eric Bavier <ericbavier@centurylink.net>. * etc/news.scm: Fix typo in English title of latest news item. Tobias Geerinckx-Rice 2019-10-27news: Add entry for /etc/guix/channels.scm....* etc/news.scm: Add entry to /etc/guix/channels.scm. Ludovic Courtès 2019-10-18news: Add CVE ID....* etc/news.scm: Add CVE ID for insecure permissions entry. Ludovic Courtès 2019-10-17news: Fix 'de' translation....* etc/news.scm: Add new 'de' translation. Florian Pelz 2019-10-16news: Fix ‘nl’ translation typo....* etc/news.scm: Fix typo. Tobias Geerinckx-Rice 2019-10-16news: Add 'de' translation....* etc/news.scm: Add new 'de' translation. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Florian Pelz 2019-10-16news: Add 'fr' translation....* etc/news.scm: Add 'fr' translation. Julien Lepiller 2019-10-16news: Add 'nl' translation....* etc/news.scm: Add 'nl' translation. Tobias Geerinckx-Rice 2019-10-16news: Add entry for security issue with /var/guix/profiles/per-user....* etc/news.scm: Add entry for security issue in multi-user setups. Ludovic Courtès 2019-09-28nls: Add ‘nl’ translation of news entries....* etc/news.scm: Add ‘nl’ translations. Tobias Geerinckx-Rice 2019-09-27nls: Update 'de' translation of news entries....* etc/news.scm: Improve 'de' translation for news entries. Florian Pelz 2019-09-27nls: Update 'de' translation of news entries....* etc/news.scm: Add 'de' translation for news entry titles. Florian Pelz 2019-09-26nls: Update 'fr' translation of news entries....* etc/news.scm: Add more 'fr' translations. Julien Lepiller 2019-09-24nls: Update 'de' translation of news entries....* etc/news.scm: Add more 'de' translations. Florian Pelz 2019-09-24news: Add entry for the glibc upgrade....* etc/news.scm: Add entry for 5f3f70391809f8791c55c05bd1646bc58508fa2c. Ludovic Courtès 2019-09-24news: Add entry for the reduced binary seed bootstrap....* etc/news.scm: Add entry for cdd3bcf03883d129581a79e6d6611b2afd3b277b. Ludovic Courtès 2019-09-23etc: Add channel news file....* etc/news.scm: New file. * Makefile.am (EXTRA_DIST): Add it. Ludovic Courtès 2019-09-08etc: Remove references to libexec/guix* from SELinux policy....* etc/guix-daemon.cil.in: Remove references to libexec/guix*. Ludovic Courtès