Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build and test to CI success #46

Merged
merged 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:bionic', 'ubuntu:focal']
container: ['ubuntu:jammy']
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
apt update -qq
apt install -qqy build-essential libcurl4-openssl-dev libjansson-dev linux-libc-dev libtool autoconf git bzip2 clang-format-10
apt install -qqy build-essential libcurl4-openssl-dev libjansson-dev linux-libc-dev libtool autoconf git bzip2 clang-format
- name: Build and Install
run: |
make build install
Expand All @@ -29,13 +29,13 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['debian:stretch', 'debian:buster']
container: ['debian:buster']
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
apt update -qq
apt install -qqy glibc-source gcc make libcurl4-gnutls-dev libjansson-dev bzip2 unzip debhelper dh-make devscripts cdbs clang apt-utils
apt-get update -qq
apt-get install -qqy glibc-source gcc make libcurl4-gnutls-dev libjansson-dev bzip2 unzip debhelper dh-make devscripts cdbs clang apt-utils
- name: Build and Install
run: |
make build install
Expand All @@ -45,7 +45,7 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['centos:7', 'centos:8']
container: ['centos:7']
steps:
- uses: actions/checkout@v2
- name: Install packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
OCTOPASS_TOKEN: ${{secrets.OCTOPASS_TOKEN}}
run: |
sudo apt update -qq
sudo apt install -qqy build-essential libcurl4-openssl-dev libjansson-dev linux-libc-dev libtool autoconf git bzip2 clang-format-10
sudo apt install -qqy build-essential libcurl4-openssl-dev libjansson-dev linux-libc-dev libtool autoconf git bzip2 clang-format libcriterion-dev
env > .env
- name: Lint
run: sudo make format
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DIST ?= unknown
SOURCES_RPM=Makefile octopass.h octopass*.c nss_octopass*.c octopass.conf.example COPYING selinux/octopass.pp
SOURCES=Makefile octopass.h octopass*.c nss_octopass*.c octopass.conf.example COPYING
VERSION=$(shell awk -F\" '/^\#define OCTOPASS_VERSION / { print $$2; exit }' octopass.h)
CRITERION_VERSION=2.3.0
CRITERION_VERSION=2.4.2
JANSSON_VERSION=2.4

INFO_COLOR=\033[1;34m
Expand All @@ -45,7 +45,7 @@ deps: ## Install dependencies
pushd tmp/libucl; ./autogen.sh; ./configure && make && make install; popd
git clone --depth=1 https://github.com/allanjude/uclcmd.git tmp/uclcmd

criterion: build_dir cache_dir ## Installing criterion
criterion: ## Installing criterion
test -f $(BUILD)/criterion.tar.bz2 || curl -sL https://github.com/Snaipe/Criterion/releases/download/v$(CRITERION_VERSION)/criterion-v$(CRITERION_VERSION)-linux-x86_64.tar.bz2 -o $(BUILD)/criterion.tar.bz2
cd $(BUILD); tar xf criterion.tar.bz2; cd ../
mv $(BUILD)/criterion-v$(CRITERION_VERSION)/include/criterion $(PREFIX)/include/criterion
Expand Down Expand Up @@ -77,7 +77,7 @@ octopass_cli: build_dir cache_dir ## Build octopass cli
$(BUILD)/nss_octopass-shadow_cli.o \
-lcurl -ljansson

test: ## Run unit testing
test: build_dir cache_dir ## Run unit testing
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Testing$(RESET)"
test -d $(PREFIX)/include/criterion || $(MAKE) criterion
$(CC) octopass_test.c \
Expand Down
6 changes: 4 additions & 2 deletions octopass_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ Test(octopass, github_user_keys, .init = setup)
const char *keys = octopass_github_user_keys(&con, user);
cr_assert_str_eq(keys,
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbBkU87QyUEmecsQjCcMTdS6iARCUXzMo2awb4c+irGPUvkXxQUljmLFRXCIw+cEKajiS7VY5NLCZ6WVCbd4yIK+3jdNzrf74isiG8GdU+m64gNGaXtKGFaQEXBp9uWqqZgSw+bVMX2ArOtoh3lP96WJQOoXsOuX0izNS5qf1Z9E01J6IpE3xfudpaL4/vY1RnljM+KUoiIPFqS1Q7kJ+8LpHvV1T9SRiocpLThXOzifzwwoo9I6emwHr+kGwODERYWYvkMEwFyOh8fKAcTdt8huUz8n6k59V9y5hZWDuxP/zhnArUMwWHiiS1C5im8baX8jxSW6RoHuetBxSUn5vR\n"
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqUJvs1vKgHRMH1dpxYcBBV687njS2YrJ+oeIKvbAbg6yL4QsJMeElcPOlmfWEYsp8vbRLXQCTvv14XJfKmgp8V9es5P/l8r5Came3X1S/muqRMONUTdygCpfyo+BJGIMVKtH8fSsBCWfJJ1EYEesyzxqc2u44yIiczM2b461tRwW+7cHNrQ6bKEY9sRMV0p/zkOdPwle30qQml+AlS1SvbrMiiJLEW75dSSENr5M+P4ciJHYXhsrgLE95+ThFPqbznZYWixxATWEYMLiK6OrSy5aYss4o9mvEBJozyrVdKyKz11zSK2D4Z/JTh8eP+NxAw5otqBmfNx+HhKRH3MhJQ==\n");
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqUJvs1vKgHRMH1dpxYcBBV687njS2YrJ+oeIKvbAbg6yL4QsJMeElcPOlmfWEYsp8vbRLXQCTvv14XJfKmgp8V9es5P/l8r5Came3X1S/muqRMONUTdygCpfyo+BJGIMVKtH8fSsBCWfJJ1EYEesyzxqc2u44yIiczM2b461tRwW+7cHNrQ6bKEY9sRMV0p/zkOdPwle30qQml+AlS1SvbrMiiJLEW75dSSENr5M+P4ciJHYXhsrgLE95+ThFPqbznZYWixxATWEYMLiK6OrSy5aYss4o9mvEBJozyrVdKyKz11zSK2D4Z/JTh8eP+NxAw5otqBmfNx+HhKRH3MhJQ==\n"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCpBXvpUsPK8zREThB1L2pk6VHLMMlM7oKwBUIrvd6Pa/PjER8oP4nXhztOUiSIeRkgShSjMtAK/O5PGeesc9RLtCn53kj9a731bCc56jxYef39PMSrS8CkF26YX0tm6Jq1cmEAkNZo+L6FY1wdLskEM+6w84XWRAE9H+/eI4ca0wY3f9VRqYjNE/rx+tr4IhLxmSgoLBKnyoRalsKsYItS5hDUcI6l6wceOmrAYrCU+oSg79Ylxc05IMbTKjnWn2A5DMcPspAftu2HEoEUD/8H4akL1HSLpac+F2zcBitc9cCBtxVh5TL3p3hXpqMDc/OmZDTPqAXz2k5h2UrYKcgdVHDVxCQL+bb/m+t6IsPk1O/bJvDZjV0yxNOsRXGtWcL6I1xkPEaR/yJNnNwsZQ/ynnmleXXB4t6H/7f96+ob+sQbpPPoN1E2ZrCfCyjp2awfN/ERVR4njBmXcbZdurcWln6i3Tv7hrARweErewr3QrBONxDm8LUWup4dHKjXSms=\n");
}

Test(octopass, github_team_members_keys, .init = setup)
Expand All @@ -484,5 +485,6 @@ Test(octopass, github_team_members_keys, .init = setup)
cr_assert_str_eq(keys,
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbBkU87QyUEmecsQjCcMTdS6iARCUXzMo2awb4c+irGPUvkXxQUljmLFRXCIw+cEKajiS7VY5NLCZ6WVCbd4yIK+3jdNzrf74isiG8GdU+m64gNGaXtKGFaQEXBp9uWqqZgSw+bVMX2ArOtoh3lP96WJQOoXsOuX0izNS5qf1Z9E01J6IpE3xfudpaL4/vY1RnljM+KUoiIPFqS1Q7kJ+8LpHvV1T9SRiocpLTh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SNmoVUflym08J4Oz676PI0onFUExEfok21AQNtt6WsUbi7Jd84Xx09HLjMFDPYyZQZWn9+u5ZIaAVPwg26T3w8FU/OJmKK+Autdm3VBc2UHTmDlL2qdrtLjcQZAMqw==\n");
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCpBXvpUsPK8zREThB1L2pk6VHLMMlM7oKwBUIrvd6Pa/PjER8oP4nXhztOUiSIeRkgShSjMtAK/O5PGeesc9RLtCn53kj9a731bCc56jxYef39PMSrS8CkF26YX0tm6Jq1cmEAkNZo+L6FY1wdLskEM+6w84XWRAE9H+/eI4ca0wY3f9VRqYjNE/rx+tr4IhLxmSgoLBKnyoRalsKsYItS5hDUcI6l6wceOmrAYrCU+oSg79Ylxc05IMbTKjnWn2A5DMcPspAftu2HEoEUD/8H4akL1HSLpac+F2zcBitc9cCBtxVh5TL3p3hXpqMDc/OmZDTPqAXz2k5h2UrYKcgdVHDVxCQL+bb/m+t6IsPk1O/bJvDZjV0yxNOsRXGtWcL6I1xkPEaR/yJNnNwsZQ/ynnmleXXB4t6H/7f96+ob+sQbpPPoN1E2ZrCfCyjp2awfN/ERVR4njBmXcbZdurcWln6i3Tv7hrARweErewr3QrBONxDm8LUWup4dHKjXSms=\n"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOm6M4O8B9dS4fwYMny+mfid2H3t/6l1BKBewrvRGJ+Z\n");
}
2 changes: 1 addition & 1 deletion test/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function test_shared_user_public_keys() {
sed -i -e 's/^#SharedUser/SharedUser/g' /etc/octopass.conf

actual="$(/usr/bin/octopass admin | wc -l)"
expected="3"
expected="4"

if [ "x$actual" == "x$expected" ]; then
pass "${FUNCNAME[0]}"
Expand Down
Loading