From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jarno Malmari Newsgroups: gmane.emacs.devel Subject: [PATCH 1/3] Revert parts of url-auth test Date: Thu, 8 Sep 2016 22:51:24 +0300 Message-ID: <1473364286-2650-2-git-send-email-jarno@malmari.fi> References: <87twljepn9.fsf@gnus.org> <1473364286-2650-1-git-send-email-jarno@malmari.fi> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1473365000 3337 195.159.176.226 (8 Sep 2016 20:03:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 20:03:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: larsi@gnus.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 08 22:03:15 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi5XX-0000NZ-Aw for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 22:03:15 +0200 Original-Received: from localhost ([::1]:53698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5XV-0002yQ-8A for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 16:03:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5Mo-0001vt-PV for emacs-devel@gnu.org; Thu, 08 Sep 2016 15:52:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi5Mj-0006Tt-TB for emacs-devel@gnu.org; Thu, 08 Sep 2016 15:52:10 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:57824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5Mh-0006PR-Jq for emacs-devel@gnu.org; Thu, 08 Sep 2016 15:52:05 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D1CA8207B4; Thu, 8 Sep 2016 15:51:54 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 08 Sep 2016 15:51:54 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=malmari.fi; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=K2TsY/lSxUNenYF/A4TwR1TNU6U =; b=ZjZYmjNKGgZ+WoP5wdgQuUj+cdBZqWsqDmRu5pE3EBS+DmPm0olOb+Zc9X7 mLFbFxOIrnKuTl31N+yZpRrOY6l6QzB+fUhuBOP472CNlN5kXoS3RIvGZ55e5r0d 3AD25cuv7Fi6klCao9mNCIt7ZfJ1NnyWLJ98O26DruENycic= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=K2Ts Y/lSxUNenYF/A4TwR1TNU6U=; b=KzwFbVb5CdwEDp/HWB3h7QmX0u4ZoCU8h7fU lmyyZb5A/3S5X0wGDa5Jt7AoSDkuiZfrMWC/QpPQyjR2Po0mUVMWbWspLjj5kqfD 928CGRAKlyLG0o6rbbR9uMS/3CuF7ka0W1yGWFn8l8PGE+KOWlh5GSw6kNtUsqqI clTAlU0= X-Sasl-enc: gpN/GM+OmUQlP3w+IkIFWmNZZSLULF0uXWkLZSOuDaj7 1473364313 Original-Received: from vabi.peto.intranet (a88-113-156-118.elisa-laajakaista.fi [88.113.156.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 6073FF2985; Thu, 8 Sep 2016 15:51:53 -0400 (EDT) X-Mailer: git-send-email 2.7.0.25.gfc10eb5 In-Reply-To: <1473364286-2650-1-git-send-email-jarno@malmari.fi> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207301 Archived-At: This reverts some parts of commit f7b0ca9dfabc16cb286265de44a3fbfc3b5e73fa that introduced QOP and digest test before their implementation. --- test/lisp/url/url-auth-tests.el | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index bc30f35..a80349d 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -36,18 +36,6 @@ url-auth-test-challenges ;; Set explicitly for easier modification for re-runs. (setq url-auth-test-challenges (list - (list :qop "auth" - :nonce "uBr3+qkQBybTr/dKWkmpUqVO7SaEwWYzyTKO7g==$" - :uri "/random/path" - :method "GET" - :realm "Some test realm" - :cnonce "YWU4NDcxYWMxMDAxMjlkMjAwMDE4MjI5MDAwMGY4NGQ=" - :nc "00000001" - :username "jytky" - :password "xi5Ac2HEfKt1lKKO05DCSqsK0u7hqqtsT" - :expected-ha1 "af521db3a83abd91262fead04fa31892" - :expected-ha2 "e490a6a147c79404b365d1f6059ddda5" - :expected-response "ecb6396e93b9e09e31f19264cfd8f854") (list :nonce "a1be8a3065e00c5bf190ad499299aea5" :opaque "d7c2a27230fc8c74bb6e06be8c9cd189" :realm "The Test Realm" @@ -183,15 +171,9 @@ url-auth-test-challenges (should-not auth))))) (ert-deftest url-auth-test-digest-auth () - "Check common authorization string contents. -Challenges with qop are not checked for response since a unique -cnonce is used for generating them which is not mocked by the -test and cannot be passed by arguments to `url-digest-auth'." + "Check common authorization string contents." (dolist (challenge url-auth-test-challenges) - (let* ((attrs (append - (list (cons "nonce" (plist-get challenge :nonce))) - (if (plist-get challenge :qop) - (list (cons "qop" (plist-get challenge :qop)))))) + (let* ((attrs (list (cons "nonce" (plist-get challenge :nonce)))) (url (concat "http://example.org" (plist-get challenge :uri))) url-digest-auth-storage auth) @@ -212,24 +194,15 @@ url-auth-test-challenges (plist-get challenge :realm) attrs)) (should auth) (should (string-prefix-p "Digest " auth)) + (should (string-match ".*response=\"\\(.*?\\)\".*" auth)) + (should (string= (match-string 1 auth) + (plist-get challenge :expected-response))) (should (string-match ".*username=\"\\(.*?\\)\".*" auth)) (should (string= (match-string 1 auth) (plist-get challenge :username))) (should (string-match ".*realm=\"\\(.*?\\)\".*" auth)) (should (string= (match-string 1 auth) (plist-get challenge :realm))) - - (if (plist-member challenge :qop) - (progn - ;; We don't know these, just check that they exists. - (should (string-match-p ".*response=\".*?\".*" auth)) - ;; url-digest-auth doesn't return these AFAICS. -;;; (should (string-match-p ".*nc=\".*?\".*" auth)) -;;; (should (string-match-p ".*cnonce=\".*?\".*" auth)) - ) - (should (string-match ".*response=\"\\(.*?\\)\".*" auth)) - (should (string= (match-string 1 auth) - (plist-get challenge :expected-response)))) ))) (ert-deftest url-auth-test-digest-auth-opaque () -- 2.7.0.25.gfc10eb5