From 032d48ad7b180c80344a8fe64b2f9bfc81cef7b1 Mon Sep 17 00:00:00 2001 From: nextcloud486153 <78801830+nextcloud486153@users.noreply.github.com> Date: Mon, 18 Apr 2022 11:59:02 +0200 Subject: Fix malformed feeds (without GUIDs) stopping the update process (fixes #1738) Signed-off-by: nextcloud486153 <78801830+nextcloud486153@users.noreply.github.com> --- tests/integration/feeds.bats | 11 +++++ tests/integration/feeds/no_guid_feed.xml | 78 ++++++++++++++++++++++++++++++++ tests/integration/helpers/settings.bash | 3 +- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 tests/integration/feeds/no_guid_feed.xml (limited to 'tests/integration') diff --git a/tests/integration/feeds.bats b/tests/integration/feeds.bats index 1e60b5552..5ad52dc30 100644 --- a/tests/integration/feeds.bats +++ b/tests/integration/feeds.bats @@ -22,6 +22,17 @@ teardown() { fi } +@test "[$TESTSUITE] Add feed without GUIDs" { + run ./occ news:feed:add "$user" "$NO_GUID_FEED" + [ "$status" -ne 0 ] + + if ! echo "$output" | grep "No parser can handle this stream"; then + ret_status=$? + echo "Malformed feed exception wasn't properly caught" + return $ret_status + fi +} + @test "[$TESTSUITE] List all" { ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" diff --git a/tests/integration/feeds/no_guid_feed.xml b/tests/integration/feeds/no_guid_feed.xml new file mode 100644 index 000000000..e27a1b07b --- /dev/null +++ b/tests/integration/feeds/no_guid_feed.xml @@ -0,0 +1,78 @@ + + + + RSS Builder by B!Soft + Joshua Wright Dot Net + http://www.joshuawright.net + This is a feed of the latest comic masterpiece from joshuawright.net + en + joshua.wright@live.com.au (Josh Wright) + joshua.wright@live.com.au (Josh Wright) + 2016 JoshuaWright + + Slack Wyrm 911 - Feeling better + Wed, 13 Apr 2022 09:07:01 +0100 + https://joshuawright.net/slack-wyrm-911.html + + + + Slack Wyrm 910 - Cake trip + Mon, 11 Apr 2022 08:52:54 +0100 + https://joshuawright.net/slack-wyrm-910.html + + + + Slack Wyrm 909 - Cake time + Fri, 8 Apr 2022 09:29:32 +0100 + + + + Slack Wyrm 908 - Dragons Lair + Wed, 6 Apr 2022 09:00:13 +0100 + https://joshuawright.net/slack-wyrm-908.html + + + + Slack Wyrm 907 - Ten feet tall + Mon, 4 Apr 2022 15:12:51 +0100 + https://joshuawright.net/slack-wyrm-907.html + + + + Slack Wyrm 906 - True self + Fri, 1 Apr 2022 09:28:06 +1100 + https://joshuawright.net/slack-wyrm-906.html + + + + Slack Wyrm 905 - Drink up + Wed, 30 Mar 2022 11:07:49 +1100 + https://joshuawright.net/slack-wyrm-905.html + + + + Slack Wyrm 904 - Marvellous medicine + Mon, 28 Mar 2022 09:02:44 +1100 + https://joshuawright.net/slack-wyrm-904.html + + + + Slack Wyrm 903 - Golden still + Fri, 25 Mar 2022 09:48:06 +1100 + https://joshuawright.net/slack-wyrm-903.html + + + + Slack Wyrm 902 - Janet the genius + Wed, 23 Mar 2022 09:30:47 +1100 + https://joshuawright.net/slack-wyrm-902.html + + + + Slack Wyrm 901 - Bye bye Bucky + Mon, 21 Mar 2022 09:01:36 +1100 + https://joshuawright.net/slack-wyrm-901.html + + + + \ No newline at end of file diff --git a/tests/integration/helpers/settings.bash b/tests/integration/helpers/settings.bash index 4e758b609..bf58a601a 100644 --- a/tests/integration/helpers/settings.bash +++ b/tests/integration/helpers/settings.bash @@ -1,3 +1,4 @@ user=admin NC_FEED="https://nextcloud.com/blog/static-feed/" -HEISE_FEED="https://www.heise.de/rss/heise-atom.xml" \ No newline at end of file +HEISE_FEED="https://www.heise.de/rss/heise-atom.xml" +NO_GUID_FEED="https://raw.githubusercontent.com/nextcloud/news/master/tests/integration/feeds/no_guid_feed.xml" -- cgit v1.2.3