From 9f46bb27ae80b3ec06a63c86210655f302578496 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 23 Jan 2018 18:11:37 +0100 Subject: add fixtures --- href_test.go | 51 +++- testdata/linux.org.ru | 676 ++++++++++++++++++++++++++++++++++++++++++++++++++ testdata/openbsd.org | 142 +++++++++++ testdata/opennet.ru | 606 ++++++++++++++++++++++++++++++++++++++++++++ testdata/undeadly.org | 405 ++++++++++++++++++++++++++++++ 5 files changed, 1871 insertions(+), 9 deletions(-) create mode 100644 testdata/linux.org.ru create mode 100644 testdata/openbsd.org create mode 100644 testdata/opennet.ru create mode 100644 testdata/undeadly.org diff --git a/href_test.go b/href_test.go index fe69810..86a0b8b 100644 --- a/href_test.go +++ b/href_test.go @@ -1,21 +1,54 @@ package main -import "testing" +import ( + "io" + "net/http" + "net/http/httptest" + "os" + "testing" +) func TestTitle(t *testing.T) { testCases := []struct { - url, title string + golden, title, contentType string }{ - {`https://www.linux.org.ru`, `LINUX.ORG.RU - Русская информация об ОС Linux`}, - {`http://www.opennet.ru`, `Проект OpenNet - всё, что связано с открытым ПО, открытыми технологиями, Linux, BSD и Unix`}, - {`http://www.openbsd.org`, `OpenBSD`}, - {`http://undeadly.org`, `OpenBSD Journal: A resource for the OpenBSD community`}, + { + `testdata/linux.org.ru`, + `LINUX.ORG.RU - Русская информация об ОС Linux`, + `text/html;charset=utf-8`, + }, + { + `testdata/opennet.ru`, + `Проект OpenNet - всё, что связано с открытым ПО, открытыми технологиями, Linux, BSD и Unix`, + `text/html; charset=koi8-r`, + }, + { + `testdata/openbsd.org`, + `OpenBSD`, + `text/html`, + }, + { + `testdata/undeadly.org`, + `OpenBSD Journal: A resource for the OpenBSD community`, + `text/html`, + }, } for _, tc := range testCases { - t.Run(tc.url, func(t *testing.T) { - title, err := getTitle(tc.url) + t.Run(tc.golden, func(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fd, err := os.Open(tc.golden) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + defer fd.Close() + w.Header().Set("Content-Type", tc.contentType) + io.Copy(w, fd) + })) + defer ts.Close() + title, err := getTitle(ts.URL) if err != nil { - t.Error(tc.url, err) + t.Error(tc.golden, err) } if title != tc.title { t.Errorf("got %v, want %v", title, tc.title) diff --git a/testdata/linux.org.ru b/testdata/linux.org.ru new file mode 100644 index 0000000..7b9c5c8 --- /dev/null +++ b/testdata/linux.org.ru @@ -0,0 +1,676 @@ + + + + + + + + + + + + + + +LINUX.ORG.RU - Русская информация об ОС Linux + + + + + + + + + + + +
+ LINUX.ORG.RU + + +
+
+
+
+
+ +
+ + + + + +
+
+

+ DuckDuckGo ужесточяет защиту приватности пользователей +

+
+ + Группа Интернет +
+
+
+

Компания DuckDuckGo заявила об ужесточении контроля за соблюдением приватности для своих пользователей. Для повышения приватности теперь предлагается защита пользовательских данных не только во время поиска в интернете, но и защита при просмотре и навигации в сети Интернет.

Для этого были выпущены обновлённые дополнения для браузеров и мобильные приложения (DuckDuckGo Mobile v4.0+).


>>> Дополнение для браузера Firefox
>>> Мобильное приложение для Android

>>> Подробности

+

 , ,

+ atsym + +() + +
+ +
+
+
+

+ Видео и презентации по итогам Linux Piter #3 доступны для просмотра +

+
+ + Группа Конференции и встречи +
+
+
+

По традиции, спустя какое-то время, мы выложили все видео по итогам LinuxPiter #3 в открытый доступ.

Каждая видео-запись имеет русскую и английскую версию. Напомню, что на конференции первый поток был на английском с синхронным переводом на русский, а второй наоборот и мы записали все звуковые дорожки. Желающие могут высказаться о качестве синхронного перевода в комметариях.

Итак: +

В ближайшее время на youtube-канале конференции Linux Piter мы опубликуем видео-интервью со спикерами в рамках проекта #DevTalkRu.

Приятного и полезного просмотра.

>>> Материалы

+

 , , ,

+ denrit + +() + +
+ +
+
+ +
+

+ Релиз Wine 3.0 +

+
+ + Группа Open Source +
+
+
+

Команда Wine выпустила очередную стабильную мажорную версию Wine.
Подготовка релиза заняла год и включает в себя 6000 изменений. Полный список улучшений, ключевые:

  • Поддержка Direct3D 10 и 11
  • Поток команд Direct3D
  • Графический драйвер Android
  • Улучшенная поддержка DirectWrite и Direct2D.

>>> Подробности

+

 ,

+ michey + +() + +
+ +
+
+
+

+ На базе ВМК МГУ начала работу «Лаборатория электроники „Байкал“» (ЛэБ) +

+
+ + Группа Hardware and Drivers +
+
+
+

В сотрудничестве с компанией «Байкал Электроникс» на базе центра обработки данных факультета ВМК МГУ имени М.В. Ломоносова начала работу «Лаборатория электроники „Байкал“» (ЛэБ). В лаборатории можно оценить производительность построенной на базе архитектуры MIPS Warrior P-class P5600 SoC Baikal-T1 и отлаживать программы для нее.

Доступ в ЛэБ организован через baik.al и baikal.cs.msu.ru. В первую очередь доступ предоставляется студентам, преподавателям и сотрудникам МГУ, возможна регистрация научных сотрудников и разработчиков ПО из других организаций.

Кроме того, в первом квартале 2018 года начнётся розничная продажа плат БФК 3.1 на основе процессора Baikal. По данным C-News, розничная стоимость платы будет около 50 000 руб. Ранее такие платы продавались только юридическим лицам и стоили около 200 000 руб.

>>> Подробности

+

 ,

+ cdslow + +() + +
+ +
+
+ +
+

+ MusE 3.0 +

+
+ + Группа Мультимедиа +
+
+
+

Выпущена новая версия MIDI-секвенсера MusE.

Главные изменения:

  • завершён порт на Qt5;
  • переписан микшер;
  • переработан диалог маршрутизации сигнала;
  • улучшена поддержка LV2, добавлена поддержка Native VST FX и Native VST shell;
  • внесены различные улучшения в плагины в собственном формате MESS;
  • добавлена поддержка RtAudio (главным образом, ради поддержки PulseAudio);
  • улучшена управляемость горячими клавишами;
  • улучшено редактирование автоматизации.

>>> Подробности

+

 , , ,

+ AP + +() + +
+ +
+
+
+

Еще новости

+ +
+
+

Январь 2018

+ +
+
+

Январь 2018

+ +
+
+
+ + +

+ + + RSS-подписка на новости + +

+
+ + +
+ +
+
+

+ О Сервере - + Правила форума
+ + Разработка и поддержка — Максим Валянский 1998–2018
+ Сервер для сайта предоставлен «ITTelo» +

+ + + +
+ + diff --git a/testdata/openbsd.org b/testdata/openbsd.org new file mode 100644 index 0000000..a18d934 --- /dev/null +++ b/testdata/openbsd.org @@ -0,0 +1,142 @@ + + + + OpenBSD + + + + + + + + + + + + + + + + + +
+
+ + [OpenBSD 6.2] +
+ + Only two remote holes in the default install, in a heck of a long time!
+
+
+ +

+ The OpenBSD project produces a FREE, multi-platform 4.4BSD-based + UNIX-like operating system. Our efforts emphasize portability, + standardization, correctness, proactive security and + integrated cryptography. As an example of the + effect OpenBSD has, the popular OpenSSH + software comes from OpenBSD. +

+ OpenBSD is freely available from our download sites. +

+ The current release is OpenBSD 6.2, released Oct 9, 2017. +

+ OpenBSD is developed entirely by volunteers. + The project's development environment + and developer events + are funded through contributions collected by + The OpenBSD Foundation. + Contributions ensure that OpenBSD will remain a vibrant and + free operating system. +

+
+ Associated projects: + OpenSSH, + OpenBGPD, + OpenNTPD, + OpenSMTPD, + OpenIKED, + mandoc, + LibreSSL +
+ + This site Copyright © 1996-2017 OpenBSD.
+
+
+ + diff --git a/testdata/opennet.ru b/testdata/opennet.ru new file mode 100644 index 0000000..d6baff5 --- /dev/null +++ b/testdata/opennet.ru @@ -0,0 +1,606 @@ + + + + OpenNet - ӣ, , , Linux, BSD Unix + + + + + + + + + + + + + + + + + +
+ + +
+
+
+The OpenNET Project / Index page +
+
+
[ /++ | | wiki | +] + +
+
+
+
+ + +
+
+
+
+
+
+
+
+ + + + + + +
+ + +
+
 
+
-
+
+
 
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
23.01 Firefox 58 (46 +14)
23.01Facebook Detectron (17 +9)
22.01 Intel (223 +57)
22.01 Minibase, Linux (73 +17)
22.01 WineD3D Windows, DirectX 11 OpenGL (56 +28)
>> 1 -
21.01 Java JavaScript (91 +2)
19.01 NeoPG GnuPG 2 (122 +26)
19.01 Git 2.16.0 (63 +30)
18.01 Wine 3.0 (139 +50)
18.01 Firefox 58 (144 +32)
18.01Google Goobuntu (Ubuntu) gLinux (Debian) (269 +63)
17.01 (50 +16)
17.01Mozilla (82 +69)
16.01 ң Chrome (60 +25)
16.01 KDE Plasma 5.12 (144 +35)
16.01 Web API Firefox HTTPS (190 –14)
16.01 BitTorrent- Transmission, (87 +14)
15.01 Coreboot 4.7 (66 +29)
15.01 LittleFS, (89 +34)
15.01 CSS, JavaScript (35 +31)
+
+
RSS | | | 20 >>
+ + + + + +
+
+ +
+
+ +
+ + + +
+ + + + + + + + +
- 15.01 USB- Yubikey 4 GPG SSH
- 02.01 WiFi- Mesh-
- 27.12
- 12.12
- 02.12 ChromiumOS QEMU
+ +

+ + +
+ + + + + + + + + + + +
- -
- CISCO- WEB
- -
- Squid . - Samba Windows
- -
+ + +

+ + +
+ + + + + + + + + + + + + + + + + + +
+
+
+, +, +ldap, +vpn... +
+
, +
+, +, +... +
+
 
Unix Web +
+, +perl, +python, +java, +php, +... +
+
, +
+firewall, +, +... +
+
 
+
+apache, +samba, +proxy, +ftp, +... +
+
+
+cisco, +linux, +bsd, +solaris, +... +
+
+
+ | +
+
+
+ +
+
+ +
+ +
+ + + +
+ + + + + + + + + + + + +
- 23.01  Firefox 58 (46 +14)
- 20.01  GNU Wget 1.19.3 (20 +16)
- 19.01  Git 2.16.0 (63 +30)
- 18.01  Wine 3.0 (139 +50)
- 17.01  web- Min 1.7 (72 –29)
- 17.01  VirtualBox 5.2.6 (26 +11)
- 16.01  web- QupZilla 2.2.4 (44 +16)
- 16.01  KDE Plasma 5.12 (144 +35)
- 15.01  NGINX Unit 0.4 (17 +8)
- 15.01  Pale Moon 27.7.0 (53 +26)
+ + + +
+  23.01 Qt 5.9.4
+  23.01 SQLite 3.22.0
+  22.01 wget 1.19.4
+  20.01 ClamAV 0.99.2.1
+  19.01 mesa 3d 17.3.3
+  19.01 cmake 3.10.2
+  18.01 GIT 2.16
+  18.01 wine 3.0
+  17.01 BIND 9.11.2-P1, 9.10.6, 9.9.11-P1
+  17.01 WordPress 4.9.2
+  16.01 MySQL 5.7.21
+  15.01 Pale Moon 27.7.0
+  15.01 NetworkManager 1.10.2, 1.8.6
+  14.01 Kdenlive 17.12.1
+  12.01 Krita 3.3.3
+  12.01 Asterisk 15.2.0, 13.19.0
+ +
RSS | >> 
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
- 17.01  (50 +16)
- 17.01  ISC BIND DHCP . KPTI BIND (18 +9)
- 17.01  Java SE, MySQL, VirtualBox Oracle (39 +6)
- 16.01  ң Chrome (60 +25)
- 16.01  BitTorrent- Transmission, (87 +14)
- 15.01  SoftEther VPN 11 (56 +16)
- 13.01  Lenovo IBM (102 +31)
- 12.01  Glibc, (68 +17)
- 12.01  - ף NPM (85 +31)
- 12.01  OpenSSH sftp, chroot (14 +10)
- 11.01 21 3D- Blender (77 +18)
- 11.01  WhatsApp Signal (54 +15)
- 10.01 Let's Encrypt (37 +11)
- 10.01  , Meltdown Spectre (213 +45)
- 10.01  Let's Encrypt (62 +20)
RSS | | >> 
+ +
+
+ + + + + + +
(RSS)
+ + + + + + + + + + + + + + + + + +
- 11:07 FreeBSD 10.3:  (1)
- 17:55 NAS cifs  (4)
- 11:53 7206 VXR PPPoE Client (5)
- 13:43 MC (11)
- 15:44 bash (4)
- 13:34 CUE (0)
- 13:20 ip iptables (4)
- 11:55  (14)
- 08:58 FTP Centos 7 (1)
- 02:14 apache . (0)
- 10:20 DHCP (12)
- 10:05 RAID0 (mdadm)? (4)
- 10:46  (6)
- 19:17 Outlook Express  (1)
- 07:30  (41)
+ + + +
+
+ + + + + + + + +
+ + +
+ + + + + +
+ +    
+     +
+
+Created 1996-2018 by Maxim Chirkov  
+   +
+
+ + +
+Hosting by Ihor + +
+
+ + + + + + diff --git a/testdata/undeadly.org b/testdata/undeadly.org new file mode 100644 index 0000000..ba7b7ef --- /dev/null +++ b/testdata/undeadly.org @@ -0,0 +1,405 @@ + + + + + + + + + +OpenBSD Journal: A resource for the OpenBSD community + + + +
+ + + + + + + + + +

OpenBSD Journal

+ + + + +

OpenBSD Journal

+
+ + +
+
+ +
+
+

CPU microcode update code for amd64

+

Contributed by +Paul 'WEiRD' de Weerd +on +from the not-very-firm-ware dept.

+
+
+

Patrick Wildt (patrick@) recently committed some code that will update the Intel microcode on many Intel CPUs, a diff initially written by Stefan Fritsch (sf@). The microcode of your CPU is basically the firmware that runs on your (Intel) processor, defining its instruction set in terms of so called "microinstructions". The new code depends, of course, on the corresponding firmware package, ported by Patrick which can be installed using a very recent fw_update(1). Of course, this all plays into the recently revealed problems in Intel (and other) CPUs, Meltdown and Spectre.

+ +
+

Read more…

+ +
+
+
+

Handling of CPU bugs disclosure 'incredibly bad': OpenBSD's de Raadt

+

Contributed by +rueda +on +from the we-are-not-amused dept.

+
+
+

ITWire +has published +an article +regarding Theo de Raadt's (deraadt@) reaction to the +Meltdown/Spectre disclosures.

+

One choice quote reads: +

+Intel engineers attended the same conferences as other company engineers, and read the same papers about performance enhancing strategies – so it is hard to believe they ignored the risky aspects. +
+

+ +
+ + +
+
+
+

OpenBSD-current now has 'smtpctl spf walk'

+

Contributed by +Peter N. M. Hansteen +on +from the check-my-senders dept.

+
+
+If you run a mail service, you probably like to have greylisting in place, via spamd(8) or similar means. However, there are some sites that simply do not play well with greylisting, and for those it's useful to extract SPF information to identify their valid outgoing SMTP hosts. +

+Now OpenBSD offers a straightforward mechanism to do that and fill your nospamd table, right from the smtpctl utility via the subcommand spf walk. Gilles Chehade (gilles@) describes how in a recent blog post titled spfwalk. +

+This feature is still in need of testing, so please grab a snapshot and test! +

+ +

+ + +
+
+
+

Response to the "Meltdown" Vulnerability

+

Contributed by +rueda +on +from the moronoculture dept.

+
+
+

A +message to tech@ +from Philip Guenther (guenther@) provides the first public +information from developers regarding the OpenBSD response to the recently +announced +CPU vulnerabilities: +

So, yes, we the OpenBSD developers are not totally asleep and a handful of
+us are working out how to deal with Intel's fuck-up aka the Meltdown
+attack.  While we have the advantage of less complexity in this area (e.g.,
+no 32bit-on-64bit compat), there's still a pile of details to work through
+about what has to be *always* in the page tables vs what can/should/must be
+hidden.
+
+

Read it +and weep…

+ +
+ + +
+
+
+

BSDCAN2017 Interview with Peter Hessler, Reyk Floeter, and Henning Brauer

+

Contributed by +rueda +on +from the Oxford comma dept.

+
+
+

In a +message to misc@, +Tom Smyth wrote (in part):

+
While  attending BSDCAN2017 in Ottawa I met many OpenBSD Developers,
+and I was fortunate to grab a few moments and video an interview
+with Peter Hessler, Henning Brauer and Reyk Floeter and talk to
+them about OpenBSD generally,
+I really appreciate the guys generosity in their time on the
+interview
+I have posted the video here
+https://www.youtube.com/watch?v=e-Xim3_rJns&feature=youtu.be
+
+

Nice work, Tom!

+ +
+ + +
+
+
+

pledge() work in progress

+

Contributed by +rueda +on +from the (the) man on pledge dept.

+
+
+

In a +message to tech@, +Theo de Raadt (deraadt@) provided some insights into ongoing +work on pledge(2):

+
+I wanted to give an update that a two pledge-related changes are being
+worked on.  The semantics and integration are complicated so it is
+taking some time.
+
+ +
+

Read more…

+ +
+
+
+

arm64 platform now officially supported [and has syspatch(8)]

+

Contributed by +rueda +on +from the not so armless dept.

+
+
+

arm64 is now an +officially supported platform for OpenBSD. +As some readers will have noticed, +there's now +syspatch(8) support, too.

+

Theo de Raadt (deraadt@) committed the following change:

+
+CVSROOT:        /cvs
+Module name:    www
+Changes by:     deraadt@cvs.openbsd.org  2017/12/07 12:00:12
+
+Modified files:
+	.              : plat.html 
+
+Log message:
+graduate arm64 to supported; having syspatch it is even beyond some other systems
+
+ +
+ + +
+ +
+
+

Reflections on Hackathons

+

Contributed by +Bob Beck +on +from the hacks from the wild dept.

+
+
+

Bob Beck (beck@) writes:

+
+

So, I am sitting in my kitchen with a car packed full of food, packing up my last things +and getting ready to drive south for a Hackathon. This one is a little different, since it is +in a wilderness hut I have to hike/ski into.. If the hike doesn't kill me, living for 5 days inside +a structure heated by wood where Germans are present to stoke the fire might. So here's +a bit of a ramble about hackathons.

+
+ +
+

Read more…

+ +
+ + +
+
+ +
+

Donate!

+

Donate to OpenBSD

+
+ +
+

Features

+

We are constantly on the lookout for stories of how you put OpenBSD to work. +Please submit any informative articles on how OpenBSD is helping your company.

+
+ + + +
+

OpenBSD Errata

+

OpenBSD 6.2

+ + + + + +
0042018-01-14 RELIABILITY An incorrect TLS extensions block is generated when no extensions are present, which can result in handshake failures.
0032017-12-10 RELIABILITY A number of bugs were discovered in the MPLS stack that can be used to remotely trigger kernel crashes.
0022017-12-01 SECURITY The fktrace(2) system call had insufficient security checks.
0012017-10-13 RELIABILITY A local user could trigger a kernel panic by using an invalid TCB value.
+ +

Unofficial RSS feed of OpenBSD errata

+
+ + + +
+

XML/RSS/RDF

+

Users wishing RSS/RDF summary files of OpenBSD Journal +can retrieve: RSS feed

+
+ +
+

Credits

+

Copyright © +- +Daniel Hartmeier. +All rights reserved. +Articles and comments are copyright their respective authors, +submission implies license to publish on this web site. +Contents of the archive prior to + as well as images +and HTML templates were copied from the fabulous original +deadly.org with +Jose's and +Jim's kind permission. +This journal runs as CGI with +httpd(8) +on OpenBSD, the +source code is +BSD licensed. +undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]

+ +
+ +
+
+ + + -- cgit v1.2.3