Skip to content

Commit

Permalink
[fixing browsers closing] Fixing tests for fedora20
Browse files Browse the repository at this point in the history
  • Loading branch information
fearenales committed Mar 23, 2015
1 parent 00d5c1d commit 59086bc
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Azkfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var build_system = function(image) {
shell: "/bin/bash",
mounts: {
"/azk/#{manifest.dir}" : '.',
"/etc/nsswitch.conf" : './mocker/nsswitch.conf',
"/etc/nsswitch.conf" : './mocker/#{system.name}-nsswitch.conf',
"/etc/resolver" : './mocker/resolver',
"/azk/build" : persistent('build-#{system.name}'),
"/azk/lib" : '/usr/lib'
Expand Down
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ $ cd libnss-resolver
# [so] options: ubuntu12, ubuntu14, fedora20
$ azk shell [so]


# using ubuntu12 or ubuntu14 as [so]:

# run tests
$ azk start dns # Run a mock dns server for testing
$ azk shell [so] -t -c "scons run-test"
Expand All @@ -35,6 +38,18 @@ $ azk shell [so] -t -c "scons run-test -Q define=DEBUG"

# install local
$ azk shell [so] -c "scons install"


# using fedora20 as [so]:

# run tests
$ azk start dns # Run a mock dns server for testing
$ azk shell [so] -t -c "scons run-test -Q prefix=/usr/lib64"
# or debug
$ azk shell [so] -t -c "scons run-test -Q define=DEBUG -Q prefix=/usr/lib64"

# install local
$ azk shell [so] -c "scons install -Q prefix=/usr/lib64"
```

Now you can add the resolver-nss in a resolution pipe:
Expand Down Expand Up @@ -65,6 +80,8 @@ $ cd libnss-resolver

# build
$ scons install
# or, if you're using Fedora as SO
$ scons install -Q prefix=/usr/lib64
```

Now you can add the resolver-nss in a resolution pipe:
Expand Down Expand Up @@ -117,16 +134,30 @@ All of these tools are actually available behind the [azk][azk]. So just use the
$ azk start dns
# [so] options: ubuntu12, ubuntu14, fedora20
$ azk shell [so] -t -c "scons local-install"
# or, if [so] == fedora20
$ azk shell [so] -t -c "scons local-install -Q prefix=/usr/lib64"
```

After that, the following scons targets are available:

```bash
# to build and run testes
# using ubuntu12 or ubuntu14 as so

# build and run tests
$ scons run-test -Q [define=DEBUG] [valgrind="valgrind options"]
# to install in azk instance
# install in azk instance
$ scons local-install
# and test with:
# test:
$ ping test.resolver


# using fedora20 as so

# build and run tests
$ scons run-test -Q prefix=/usr/lib64 -Q [define=DEBUG] [valgrind="valgrind options"]
# install in azk instance
$ scons local-install -Q prefix=/usr/lib64
# test:
$ ping test.resolver
```

Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ env['ENV']['VALGRIND_OPTS'] = ARGUMENTS.get('valgrind', '')
env['ENV']['LD_LIBRARY_PATH'] = '/usr/local/lib'

test_bin = "%s/test" % build_dir
test_app = env.Program(test_bin, ["src/resolver.c", "src/files.c", Glob("test/*.c")] + so_local + cmocka,
test_app = env.Program(test_bin, so_local + cmocka + ["src/resolver.c", "src/files.c", Glob("test/*.c")],
LIBS = [cmocka, cares],
CFLAGS = ("%s -I/usr/local/include -I%s -I%s/include" % (DEBUG, cares_folder, cmocka_folder[0])),
LINKFLAGS = "-Wl,--no-as-needed -lrt -lcmocka")
Expand Down
63 changes: 63 additions & 0 deletions mocker/fedora20-nsswitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
# nisplus Use NIS+ (NIS version 3)
# nis Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files sss
shadow: files sss
group: files sss
initgroups: files

#hosts: db files nisplus nis dns
hosts: files resolver dns myhostname

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files sss

netgroup: nisplus sss

publickey: nisplus

automount: files nisplus
aliases: files nisplus
File renamed without changes.
19 changes: 19 additions & 0 deletions mocker/ubuntu14-nsswitch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat

hosts: files resolver dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

0 comments on commit 59086bc

Please sign in to comment.