Skip to content

Commit

Permalink
Post-release test and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Oct 29, 2024
1 parent e0ebe41 commit 0586e94
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 36 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Clixon Changelog

* [7.3.0](#730) Expected: January 2025
* [7.2.0](#720) 28 October 2024
* [7.1.0](#710) 3 July 2024
* [7.0.1](#701) 3 April 2024
Expand All @@ -11,10 +12,13 @@
* [6.1.0](#610) 19 Feb 2023
* [6.0.0](#600) 29 Nov 2022

## 7.3.0
Expected: January 2025

## 7.2.0
28 October 2024

The 7.2.0 release lots of minor changes and bugfixes including memory optimizations and package builds.
The 7.2.0 release features several minor changes and bug-fixes including memory optimizations and package builds.

### Features

Expand Down
10 changes: 0 additions & 10 deletions doc/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ What to think about when doing a new release.
* Draft a new release and review generated release notes and use info to update CHANGELOG
* Review README.md
* New yang/clicon/clixon-config@XXX.yang revision?
* In configure.ac, for minor releases change CLIXON_VERSION in configure.ac to eg: (minor should have been bumped) (OBSOLETE):
```
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
```
* For patch releases change CLIXON_VERSION_PATCH
* Run autoconf
* Git stuff:
```
Expand All @@ -186,11 +181,6 @@ What to think about when doing a new release.
* Add a github release and copy release info from CHANGELOG

After release:
* Bump minor version.
```
CLIXON_VERSION_MINOR="10" ++
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
```
* Run autoconf

Create release branch:
Expand Down
41 changes: 30 additions & 11 deletions docker/example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# ***** END LICENSE BLOCK *****
#

FROM alpine
FROM alpine:latest
LABEL maintainer="Olof Hagsand <olof@hagsand.se>"

# For clixon and cligen
Expand All @@ -41,17 +41,22 @@ RUN apk add --update git make build-base gcc flex bison curl-dev
# nghttp2 dependencies
RUN apk add --update nghttp2

# For netsnmp
RUN apk add --update net-snmp net-snmp-dev

# For groupadd/groupdel
RUN apk add --update shadow

# Create a directory to hold source-code, dependencies etc
RUN mkdir -p /clixon/build

WORKDIR /clixon

# Clone cligen
RUN git clone https://github.com/clicon/cligen.git

# Build cligen
WORKDIR /clixon/cligen
RUN ./configure --prefix=/usr/local
RUN ./configure --prefix=/usr/local --sysconfdir=/etc
RUN make
RUN make DESTDIR=/clixon/build install

Expand All @@ -64,16 +69,18 @@ WORKDIR /clixon/clixon
COPY clixon .

# Configure, build and install clixon
RUN ./configure --prefix=/usr/local --with-cligen=/clixon/build/usr/local --with-restconf=native --enable-nghttp2 --enable-http1
RUN ./configure --prefix=/usr/local --sysconfdir=/etc --with-cligen=/clixon/build/usr/local --with-restconf=native --enable-nghttp2 --enable-http1 --enable-netsnmp

RUN make
RUN make DESTDIR=/clixon/build install
RUN make DESTDIR=/clixon/build install-include

# Install main example
# Build and install the clixon example
WORKDIR /clixon/clixon/example/main
RUN make
RUN make DESTDIR=/clixon/build install
RUN mkdir -p /clixon/build/etc
RUN install example.xml /clixon/build/etc/clixon.xml

# Copy startscript
WORKDIR /clixon
Expand All @@ -83,17 +90,29 @@ RUN install startsystem.sh /clixon/build/usr/local/bin/
#
# Stage 2
# The second step skips the development environment and builds a runtime system
FROM alpine
FROM alpine:latest
MAINTAINER Olof Hagsand <olof@hagsand.se>

# For clixon and cligen
RUN apk add --update flex bison
RUN apk add --update flex bison openssl

# need to add www user manually
RUN adduser -D -H -G www-data www-data

# openssl and nghttp2 dependencies
RUN apk add --update openssl nghttp2
# nghttp2 dependencies
RUN apk add --update nghttp2

# For SNMP
RUN apk add --update net-snmp net-snmp-tools

# Some custom configuration for SNMP
RUN echo "master agentx" > /etc/snmp/snmpd.conf
RUN echo "agentaddress 127.0.0.1" >> /etc/snmp/snmpd.conf
RUN echo "rwcommunity public localhost" >> /etc/snmp/snmpd.conf
RUN echo "agentxsocket unix:/var/run/snmp.sock" >> /etc/snmp/snmpd.conf
RUN echo "agentxperms 777 777" >> /etc/snmp/snmpd.conf
RUN echo "trap2sink localhost public 162" >> /etc/snmp/snmpd.conf
RUN echo "disableAuthorization yes" >> /etc/snmp/snmptrapd.conf

# Expose https port for restconf
EXPOSE 80/tcp
Expand All @@ -111,9 +130,9 @@ RUN adduser -D -H clicon
COPY --from=0 /clixon/build/ /

# Overwrite config file since install dirs are wrong
COPY example.xml /usr/local/etc/example.xml
COPY example.xml /usr/local/etc/clixon/example.xml
# Create symlink so you can run clixon without -f arg
RUN ln -s /usr/local/etc/example.xml /usr/local/etc/clixon.xml
RUN ln -s /usr/local/etc/clixon/example.xml /usr/local/etc/clixon.xml

# Start daemons
CMD /usr/local/bin/startsystem.sh
6 changes: 2 additions & 4 deletions docker/example/startsystem.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (C) 2017-2019 Olof Hagsand
Expand Down Expand Up @@ -54,10 +54,8 @@ touch /run/openrc/softlevel
#/usr/local/bin/clixon_restconf -l f/var/log/restconf.log -D $DBG &
#>&2 echo "clixon_restconf started"

#ln -s /usr/local/etc/example.xml clixon.xml

# Start clixon backend
/usr/local/sbin/clixon_backend -D $DBG -s running -l e -f /usr/local/etc/example.xml
/usr/local/sbin/clixon_backend -D $DBG -s running -l e -f /usr/local/etc/clixon/example.xml
>&2 echo "clixon_backend started"

# Alt: let backend be in foreground, but test scripts may
Expand Down
10 changes: 2 additions & 8 deletions test/fuzz/backend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clixon fuzzing

This dir contains code for fuzzing clixon backend. (NOTE DOES NOT WORK)
This dir contains code for fuzzing clixon backend.

It requires the preeny package to change sockets to stdio.

Expand All @@ -12,15 +12,9 @@ Install AFL and preeny, see [..](..)

## Build

Make a modification to how Clixon sends internal messages in `include/clixon_custom.h`:
```
#define CLIXON_PROTO_PLAIN
```
(Note this is obsolete)

Build clixon statically with the afl-clang compiler:
```
CC=/usr/bin/afl-clang-fast LINKAGE=static ./configure --with-restconf=native
CC=/usr/bin/afl-clang-fast LINKAGE=static ./configure
make clean
make
sudo make install
Expand Down
5 changes: 4 additions & 1 deletion test/fuzz/backend/input/1.xml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42" username="olof"><edit-config><target><candidate/></target><default-operation>merge</default-operation><test-option>test-then-set</test-option><error-option>stop-on-error</error-option><config><table xmlns="urn:example:clixon"><parameter><name>eth/0/0</name><value>x</value></parameter></table></config></edit-config></rpc>]]>]]>

#391
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42" username="olof"><edit-config><target><candidate/></target><default-operation>merge</default-operation><test-option>test-then-set</test-option><error-option>stop-on-error</error-option><config><table xmlns="urn:example:clixon"><parameter><name>eth/0/0</name><value>x</value></parameter></table></config></edit-config></rpc>
##
5 changes: 4 additions & 1 deletion test/fuzz/backend/input/2.xml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<hello username="olof" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"><capabilities><capability>urn:ietf:params:netconf:base:1.0</capability></capabilities></hello>]]>]]>

#181
<hello username="olof" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"><capabilities><capability>urn:ietf:params:netconf:base:1.0</capability></capabilities></hello>
##

0 comments on commit 0586e94

Please sign in to comment.